【问题标题】:Report Viewer in WPF?WPF 中的报表查看器?
【发布时间】:2014-03-12 09:02:03
【问题描述】:

我想在我的 WPF 项目中添加一个报表查看器(就像水晶报表查看器一样)。 Here 我找到了一个链接来做到这一点。但这是由 windowsForm Control Hosting 完成的。我想在不托管 winFom 控件的情况下添加报表查看器。

【问题讨论】:

    标签: c# wpf winforms crystal-reports reportviewer


    【解决方案1】:

    我相信水晶报表(实际上是 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”。我猜这些通常是随水晶报表开发版一起下载的。

    注意 - 如果您需要完整的教程,截至本回答,您可以找到更多信息 at C-Sharp Corner here。文章的第二页是他们实际创建报告并将其添加到表单的地方。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-30
      • 1970-01-01
      • 2016-09-18
      • 2020-06-20
      相关资源
      最近更新 更多