【发布时间】:2011-04-28 05:34:56
【问题描述】:
我有一个 WPF 应用程序,我想在其中显示 SQL Server Reporting Services sql 2008 报表。我知道我们必须使用主机寡妇控件,然后在报表查看器控件中使用。我想使用远程处理模式。 我的代码示例是: 我添加了命名空间:
使用 System.Windows.Forms;
使用 System.Windows.Forms.Integration;
使用 Microsoft.Reporting;
使用 Microsoft.ReportingServices;
使用 Microsoft.Reporting.WinForms;
我的 XAML:
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:wfr="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
Title="ReportHost" Height="300" Width="300">
<Grid>
<wfi:WindowsFormsHost Height="100" Margin="39,27,39,0" Name="winFormsHost" VerticalAlignment="Top" >
<wfr:ReportViewer x:Name="rptViewer" ProcessingMode="Remote" />
</wfi:WindowsFormsHost>
</Grid>
代码:
rptViewer.ServerReport.ReportServerUrl =
new Uri("http://mymachine-:8080/ReportServer_myreports");
rptViewer.ServerReport.ReportPath="/Reports/mytestreport.rdl";
rptViewer.ServerReport.Refresh();
我的问题是如何在 microsoft 报表查看器控件中设置选择公式 [如水晶报表]。或者 miscroft 提供了其他任何类似于水晶报表中的选择公式的其他内容。
当我运行代码时,它只在主机窗口控件中显示报表查看器,而不是在窗口中显示报表数据。
请有人向我提供所有步骤列表,我必须通过示例代码来获得所需的结果。
我们会尽快回复。
【问题讨论】:
标签: wpf reportviewer