[英]How to use .rdlc and ReportViewer with Page template in wpf?
我正在使用WPF,我想从我的集合中创建报告,但我无法在页面模板中加载ReportViewer,因为您知道在Windows模板中我们可以轻松使用ReportViewer但是如果您在Windows模板中使用Frame模板中的页面模板比ReportViewer不起作用。
那么你有什么想法我如何在页面中使用ReportViewer(在框架中加载)以下代码我可以轻松加载由于Windows模板的ReportViwer
<Window x:Class="WpfReportApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
Title="MainWindow" Height="350" Width="525">
<Grid>
<WindowsFormsHost>
<rv:ReportViewer x:Name="_reportViewer"/>
</WindowsFormsHost>
</Grid>
我想在以下模板中使用ReportViewer。
<Page x:Class="WpfReportApplication.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:rv="clr-namespace:Microsoft.Reporting.WinForms;assembly=Microsoft.ReportViewer.WinForms"
<Grid>
<WindowsFormsHost>
<rv:ReportViewer x:Name="_reportViewer"/>
</WindowsFormsHost>
</Grid>
Windows模板中的模板。 我的页面流如下所示。
<Window> template --> Frame (Control) --> Loading <Page> template (using FrameNavigationService(new Page()) from MainWindows.xaml.cs.
我尝试了一些链接,但所有的窗口模板不是页面模板。
任何建议/解决方案高度赞赏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.