积极答复者
VS2008 WPF RDLC

问题
答案
-
你好!
用WindowFormHost控件,直接集成报表到WPF窗体中,具体可以参考一下这里:
http://blog.csdn.net/lnwuyaowei/archive/2008/04/21/2312205.aspx
希望对你有帮助!
周雪峰- 已标记为答案 YiChun Chen 2009年12月1日 10:05
全部回复
-
你好!
用WindowFormHost控件,直接集成报表到WPF窗体中,具体可以参考一下这里:
http://blog.csdn.net/lnwuyaowei/archive/2008/04/21/2312205.aspx
希望对你有帮助!
周雪峰- 已标记为答案 YiChun Chen 2009年12月1日 10:05
-
谢谢你的答案,你的回答很有帮助。 我写了这样的代码,报表就就是不能显示,能帮我看看,是什么问题吗, 只想显示个空报表,
public Window1()
{
Microsoft.Reporting.WinForms.ReportViewer rep = new Microsoft.Reporting.WinForms.ReportViewer();
rep.LocalReport.ReportPath = "EnglishReport.rdlc";
rep.ShowToolBar = true;
//这里取数据源数据
//rep.LocalReport.DataSources = list
//Microsoft.Reporting.WinForms.ReportDataSource rds = new Microsoft.Reporting.WinForms.ReportDataSource("NorthwindDataSet_Orders", myds.Tables[0]);
//Microsoft.Reporting.WinForms.ReportDataSource rds1 = new Microsoft.Reporting.WinForms.ReportDataSource("StudyEnglish_Dictionary", list);
//rep.LocalReport.DataSources.Clear();
//rep.LocalReport.DataSources.Add(rds1);
rep.RefreshReport();
} -
提示找不到 WindowsFormsHost 控件,我已经加了引用
<my:WindowsFormsHost Margin="341,249,237,165" Name="windowsFormsHost1"
xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" OverridesDefaultStyle="False">
<wf:ReportViewer Name="rp"></wf:ReportViewer>
</my:WindowsFormsHost>