![](/img/trans.png)
[英]how to create custom control in visual studio 2015 and add it to toolbox
[英]ReportViewer Control Is not Visible in the Toolbox visual studio 2015
我一次又一次地尝试将ReportViewer控件添加到工具箱中。
我不知道如何解决这个问题。
谢谢
您需要修改Visual Studio:
在此之后,您可以在Visual Studio中看到ReportViewer。
如果您已经管理并执行了以下步骤:
打开“控制面板”>“程序”>“程序和功能”,然后选择适用于您的Microsoft Visual Studio 2015版本的条目。在我们的示例中,它是Microsoft Visual Studio Enterprise 2015.单击程序列表上方顶部栏上的“更改”按钮。 启动画面后,将打开一个窗口。 按“修改”按钮。 选择“Windows和Web开发”>“Microsoft SQL Server数据工具”,然后选中它旁边的框。 按下窗口右下角的“更新”按钮。 安装完成后,打开您的Visual Studio版本。 加载新的.dll文件后,应重新实现报告功能,并且您应该能够访问所有相关的表单,控件和对象。
如果您已安装:
Microsoft.ReportViewer.VS2015.WebForms 3 Microsoft.ReportViewer.2015.Runtime
Microsof report viewer 2015(来自Manage Nuget Packeges for Solution或在此处获取https://www.microsoft.com/en-us/download/details.aspx?id=45496 )
并且您无法创建报告,请尝试以下步骤:
启动Visual Studio。 在表单设计模式下,转到控件工具箱并右键单击它。 选择“选择项目...”后
>点击浏览后选择元素
C:\\ WINDOWS \\装配\\ GAC_MSIL \\ Microsoft.ReportViewer.Common \\ 12.0.0.0__89845dcd8080cc91
我不认为VS 2015与控件捆绑在一起。 在这里得到它https://www.microsoft.com/en-us/download/details.aspx?id=45496
它在视觉工作室2015中为我工作。右键单击解决方案资源管理器并选择管理NuGet包以获得解决方案并搜索Microsoft.ReportViewer.WinForms.VS2015.WinForms并安装它。 安装后在.xaml页面中添加命名空间xmlns:rv =“clr-namespace:Microsoft.Reporting.WinForms; assembly = Microsoft.ReportViewer.WinForms”。 将WindowsFormsHost控件拖放到.xaml页面上。 并在.xaml页面中添加以下内容
<Grid>
<WindowsFormsHost>
<rv:ReportViewer x:Name="_reportViewer"/>
</WindowsFormsHost>
</Grid>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.