Tag: localreport

.NET LocalReport / .rdlc AppDomain问题

我正在使用Microsoft.Reporting.WebForms.LocalReport和.rdlc报告文件来生成.pdf:s。 这是在Windows服务(.NET 4.6,x64,VS2015)的后台完成的。 我有两个问题: Windows服务不断消耗内存,最终抛出OutOfMemoryException并终止进程 在一个事件中,整个WindowsSerivce以UnhandledException终止,尽管所有内容都包含在try-catch语句中。 现在,我已经阅读了.NET 4下的LocalReport已经改为生活在它自己的AppDomain中。 所以,在使用LocalReport时: 你应该总是在每个localReport.Render()之后调用localReport.ReleaseSandboxAppDomain()吗? 我是否必须做一些事情来处理LocalReport沙箱AppDomain中可能发生的任何exception?

如何在ReportViewer中将Datatable设置为数据源

我在ReportViewer中搜索关于Datatable作为datasource的最后一个问题,我发现这是解决方案 DataTable table = new DataTable(); table.Columns.Add(“value”, typeof(string)); table.Columns.Add(“price”, typeof(string)); table.Columns.Add(“quantity”, typeof(string)); table.Rows.Add(“test1″,”10″,”20”); table.Rows.Add(“test2”, “10”, “20”); reportViewer1.LocalReport.DataSources.Clear(); ReportDataSource rprtDTSource = new ReportDataSource(“TITLE”,table); reportViewer1.LocalReport.DataSources.Add(rprtDTSource); reportViewer1.RefreshReport(); 但我得到这个图像的结果 问题是什么 ??

在我的winform应用程序中获取rdlc报告的相对路径

我将在月末流程中自动从一些报告中创建PDF。 我遇到了ReportViewer.LocalReport无法找到我的报告的问题。 在项目中,报告文件位于“(项目根文件夹)/Reports/report.rdlc”中。 如何设置ReportViewer.LocalReport.ReportPath以便我可以引用我的报告文件? 我宁愿不设置完整路径,因为我不知道在客户端计算机上安装它将在何处安装。