在asp.net中使用crystalreport [英] use crystalreport in asp.net

查看:109
本文介绍了在asp.net中使用crystalreport的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我如何在asp.net中使用Crystal Report
请给我示例代码
最好的问候

解决方案

只需使用以下代码:

首先添加三个参考文献:

 使用 CrystalDecisions.CrystalReports.Engine;
使用 CrystalDecisions.Shared;
使用 CrystalDecisions.Reporting;


 受保护的 无效 Page_Init(对象发​​件人,EventArgs e)
    {
        ReportDocument cr;
        字符串 data = " ;
        SqlDataAdapter ad1 =  SqlDataAdapter(数据,连接);
        DataSet ds1 =  DataSet();
        ad1.Fill(ds1);

        路径= Server.MapPath(" );
        cr =  ReportDocument();
        cr.Load(path);

        cr.SetDataSource(ds1.Tables [ 0 ]);
        CrystalReportViewer1.ReportSource = cr;

    }

将帮助您如果不这样做,请发布它.
享受.


有很多文章,
参见
http://highoncoding. com/Articles/550_Creating_Crystal_Report_in_ASP_NET.aspx [ ^ ]
^ ]
http://csharpdotnetfreak.blogspot.com/2009/07/creating-crystal-reports-in-aspnet.html [ ^ ]


嗨...

请找到以下链接..

在Visual Studio 2010中使用Crystal Reports生成报告 [ ^ ]

使用带有数据集的C#创建Crystal报表 [ ^ ]

http://www.dotnetspider.com/resources/43691-How- create-sub-reports-crystal-report.aspx [ ^ ]

这将帮助您


hi how can i use crystal report in asp.net
please send me sample code
best regards

解决方案

Just Use Below Code :

add three References first :

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using CrystalDecisions.Reporting;


 protected void Page_Init(object sender, EventArgs e)
    {
        ReportDocument cr;
        String data = "SELECT * from tablename";
        SqlDataAdapter ad1 = new SqlDataAdapter(data, connection);
        DataSet ds1 = new DataSet();
        ad1.Fill(ds1);

        path = Server.MapPath("report1.rpt");
        cr = new ReportDocument();
        cr.Load(path);

        cr.SetDataSource(ds1.Tables[0]);
        CrystalReportViewer1.ReportSource = cr;

    }

this will help you if not please post it.
Enjoy.


There are lot of articles,
See
http://highoncoding.com/Articles/550_Creating_Crystal_Report_in_ASP_NET.aspx[^]
Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report[^]
http://csharpdotnetfreak.blogspot.com/2009/07/creating-crystal-reports-in-aspnet.html[^]


Hi ...

Please find the below link..

Generate a Report using Crystal Reports in Visual Studio 2010[^]

Creating Crystal Reports using C# with Datasets[^]

http://www.dotnetspider.com/resources/43691-How-create-sub-reports-crystal-report.aspx[^]

It will help u


这篇关于在asp.net中使用crystalreport的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆