如何在ASP.NET中显示水晶报表 [英] How to display crystal reports in ASP.NET
本文介绍了如何在ASP.NET中显示水晶报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨..
我需要使用水晶报告显示报告,我是网络新手,所以请帮助我
我尝试了一些东西但是,当我'我正在运行我的代码它没有显示任何内容。
我尝试过:
Hi..
I need to display report using crystal reports, i'm new to net,so please help me
I tried something but, when i'm running my code it's displaying nothing.
What I have tried:
ReportDocument reportdocument = new ReportDocument();
reportdocument.Load(Server.MapPath("~/CrystalReport2.rpt"));
DataSet1 dsPersonInfo = new DataSet1();
SqlConnection con = new SqlConnection("Data Source=localhost;user id=sa; password=sa;Initial Catalog=test;");
con.Open();
SqlCommand cmd = new SqlCommand("select * from PersonInfo", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dsPersonInfo, "PersonInfo");
con.Close();
reportdocument.SetDataSource(dsPersonInfo);
CrystalReportViewer1.ReportSource = reportdocument;
CrystalReportViewer1.DataBind();
PersonInfo
是数据集DataTable名称
谢谢
is Dataset DataTable Name
Thanks
推荐答案
希望这是useul,
使用其功能组逐步创建Crystal Report,图表,交叉表和子报表 [ ^ ]
Hope this is useul,
Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report[^]
这篇关于如何在ASP.NET中显示水晶报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文