使用RDLC报告的Winforms中的部署问题 [英] Deployment Problem in Winforms with RDLC Report

查看:72
本文介绍了使用RDLC报告的Winforms中的部署问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况,我有一个使用Microsoft Report Viewer Control的Windows应用程序。我正在使用以下代码在我的开发机器上正常工作。



reportPath =



ABS_Monthly_Expense_Recorder.REPORT.Report_By_Date.rptDate.rdlc;





//设置ReportViewer对象的活动报告路径



reportViewer1.LocalReport.ReportEmbeddedResource = reportPath;





//添加数据源到当地报道





//请注意,名称应作为参数传递或





//从报告文件中解析



reportViewer1.LocalReport.DataSources.Add(



新的ReportDataSource(FinancleReport_MainTable,dsFinance.Tables [FinanceReport]));



reportViewer1.RefreshReport() ;



我现在把调试文件夹放在另一台安装了.Net框架的机器上。 exe工作正常,其他形式工作正常。但是,包含报表查看器控件的表单虽然加载正常但在生成报表时出错。我已将以下两个dll包含在与exe相同的目录中,因为包含报表Viewer控件的表单没有加载它们:

解决方案

确保部署的系统存在于Dll之后

 Microsoft.ReportViewer.WinForms 
Microsoft.ReportViewer.ProcessingObjectModel
Microsoft.ReportViewer.Common





即使它在那里并确保这些DLL的版本与项目参考中的DLL一起





其他明智地将这些DLL复制到您的项目文件夹。





希望这将适用于你


I have a situation where I have a windows application that uses Microsoft Report Viewer Control. I am using the following code which is working fine on my development machine.

reportPath =

"ABS_Monthly_Expense_Recorder.REPORT.Report_By_Date.rptDate.rdlc";


// Set the active report path of the ReportViewer object

reportViewer1.LocalReport.ReportEmbeddedResource = reportPath;


// Add data source to the local report


// Note that the name should either be passed as parameter or


// parsed from the report document

reportViewer1.LocalReport.DataSources.Add(

new ReportDataSource("FinancleReport_MainTable", dsFinance.Tables["FinanceReport"]));

reportViewer1.RefreshReport();

I now took the debug folder on a different machine where they have only .Net framework installed. The exe is working fine, other forms are working perfectly. However, the form containing the report viewer control, though loads fine but giving an error while generating report. I have included the following two dlls in the same directory as the exe, as the form containing the report Viewer control wasn't loading without them:

解决方案

Make sure that the deployed system exists following Dll's

Microsoft.ReportViewer.WinForms
Microsoft.ReportViewer.ProcessingObjectModel
Microsoft.ReportViewer.Common



even if it is there and make sure that version of these DLL's with DLL's in the Project reference


Other wise copy these DLL's to your project folder.


Hope this will works for you.


这篇关于使用RDLC报告的Winforms中的部署问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆