WPF 中的报表查看器



我想在我的 WPF 项目中添加一个报表查看器(就像水晶报表查看器一样)。在这里,我找到了一个链接来执行此操作。但这是由 windowsForm Control Hosting 完成的。我想添加报表查看器而不承载 winFom 控件。

我相信

水晶报告(实际上是SAP)有一个WPF版本的查看器。它可以与以下代码一起使用(作为示例):

<Window x:Class="WpfCrystalReport.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:SAPBusinessObjects.WPF.Viewer;assembly=
                                                                               SAPBusinessObjects.WPF.Viewer"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <my:CrystalReportsViewer HorizontalAlignment="Left" Name="crystalReportsViewer1"
                                 VerticalAlignment="Top" Height="500" Width="500" />
    </Grid>
</Window> 

您需要确保引用"SAPBusinessObjects.WPF.Viewer.dll"并引用"SAPBusinessObjects.WPF.ViewerShared.dll"。我猜这些通常是与水晶报告开发版本一起下载的。

注意 - 如果您需要完整的教程,截至本答案,您可以在C-Sharp Corner找到更多信息 这里.文章的第二页是他们实际创建报表并将其添加到窗体的位置。

最新更新