请提供帮助:在Winform中使用Reportviewer显示或查看.rpt报告 [英] help please: display or view .rpt report with Reportviewer in winform
本文介绍了请提供帮助:在Winform中使用Reportviewer显示或查看.rpt报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助:我正在使用Visual Studio 2010和Crystal Report XI.我创建了一个包含我的数据的.rpt报告.我需要使用reportviewer显示此报告.我尝试了很多,但没有找到任何解决方案.到现在为止我是这样的:
Help Please: I am using visual studio 2010 and crystal report XI. I have created a .rpt report which contains my data. I need to display this report using reportviewer. I tried a lot but didn''t find any solution. Upto now where I am is as following:
string constr = "Data Source=BITS;Initial Catalog=TEST_DB;User ID=sa;Password=123456";
SqlConnection sqlcon = new SqlConnection(constr);
string query;
query = "SELECT * FROM t_Student";
sqlcon.Open();
SqlDataAdapter da = new SqlDataAdapter(query, constr);
DataSet ds = new DataSet();
da.Fill(ds, "t_Student");
Microsoft.Reporting.WinForms.ReportDataSource reportDataSource = new Microsoft.Reporting.WinForms.ReportDataSource();
reportDataSource.Name = "StudentListView";
reportDataSource.Value = "StudentListView.rpt";
reportViewer1.LocalReport.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource("ds_t_Student", ds.Tables[0]));
reportViewer1.LocalReport.DataSources.Add(reportDataSource);
reportViewer1.LocalReport.ReportPath = "StudentListView.rpt";
sqlcon.Close();
****************************************
请尽快回复我.
***************
谢谢
************************************
Please reply me as soon as you can.
***************
Thanks
推荐答案
您可以参考此链接以进一步了解
http://csharpdotnetfreak.blogspot.com/2009/07/crystal-reports-in-winforms-parameter.html
http://aspalliance.com/1297_Displaying_Crystal_Reports_using_WinForms_and_C.all
谢谢&问候,
耶万(Jeevan)
Hi,
You can refer this links for further
http://csharpdotnetfreak.blogspot.com/2009/07/crystal-reports-in-winforms-parameter.html
http://aspalliance.com/1297_Displaying_Crystal_Reports_using_WinForms_and_C.all
Thanks & Regards,
Jeevan
这篇关于请提供帮助:在Winform中使用Reportviewer显示或查看.rpt报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文