0
當前有not an available WPF viewer for Active Reports 6。我試圖使用主機控件在互操作主機中顯示查看器,但我沒有太多運氣。有沒有其他人試圖成功?我甚至無法將包裝器查看器控件作爲自定義控件添加到項目工具箱中。我希望避免重新創建輪子。WPF窗口中託管的Active Reports winforms查看器控件
當前有not an available WPF viewer for Active Reports 6。我試圖使用主機控件在互操作主機中顯示查看器,但我沒有太多運氣。有沒有其他人試圖成功?我甚至無法將包裝器查看器控件作爲自定義控件添加到項目工具箱中。我希望避免重新創建輪子。WPF窗口中託管的Active Reports winforms查看器控件
現有的ActiveReports Viewer在WPF中工作正常。你可以用下面的XAML來承載它在WPF:
<Window x:Class="ARViewerHostedInWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:arv="clr-namespace:DataDynamics.ActiveReports.Viewer;assembly=ActiveReports.Viewer6"
Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
<Grid>
<WindowsFormsHost Name="windowsFormsHost1">
<arv:Viewer x:Name="ARViewer" Dock="Fill" />
</WindowsFormsHost>
</Grid>
</Window>
在XAML文件的代碼隱藏在下面的代碼將在上面的XAML報告連接到瀏覽器,並運行它:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
NewActiveReport1 rpt = new NewActiveReport1();
this.ARViewer.Document = rpt.Document;
rpt.Run();
}
}
我正在使用currently available version of ActiveReports 6進行測試。
希望這會有所幫助!
Scott Willeke
GrapeCity