wpf - 使用 WindowsformsHost 将报表查看器插入 WPF 应用程序时出现问题

标签 wpf windows forms integration reportviewer

我正在尝试从我的 WPF 应用程序创建一个弹出窗口,其中显示托管在 WindowsFormsHost 中的报表查看器 但是我在使用以下 Xaml 时遇到问题

<Page x:Class="FIS3.ReportViewer.ReportViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
Title="MapViewer">
<Grid>
    <my:WindowsFormsHost>

    </my:WindowsFormsHost>
    <Label Name="exampleText" Content="this is the Report Viewer ..." />
</Grid>

我收到一个构建错误,通知我 “未找到类型‘my:WindowsFormsHost’。请验证您是否缺少程序集引用,并且所有引用的程序集均已构建”

我的 XAML 中是否犯了错误 我已添加 WindowsFormsIntegration 作为对我的项目的引用。

感谢您的帮助

最佳答案

人们似乎忽视了第二种解决方案。我为这个问题挠了足足 20 分钟。没有一种解决方案,包括这个解决方案,是行得通的。事实证明我的解决方案是添加:

WindowsForms集成

我的引用资料

当我意识到基于:

http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.windowsformshost.aspx

这使用了 WindowsFormsIntegration.dll。我的引用文献中似乎缺少它。

希望这有帮助!

关于wpf - 使用 WindowsformsHost 将报表查看器插入 WPF 应用程序时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2100660/

相关文章:

c# - 具有确定操作的 Caliburn MVVM WPF 对话框

WPF ProgressBar - 绑定(bind)进度值以显示在栏上

c++ - Windows 与 Linux - 数学结果差异

java - 如何使用NIO获取有关Windows快捷方式来源的信息?

jQuery 使用自动完成功能限制文本框输入

c# - 在ViewModels之间共享observableCollection

c# - 将鼠标悬停在 wpf 中的按钮上时,如何显示自定义文本框

python - 如何更改 Windows 文件的文件创建日期?

javascript - 从 html 表单到 javascript

javascript - cfform 目标 iframe 页面丢失