在ASP.NET类(而不是.aspx)中呈现rdlc报告时出错 [英] Error during rendering rdlc report in class ASP.NET (not .aspx)

查看:105
本文介绍了在ASP.NET类(而不是.aspx)中呈现rdlc报告时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我想用class中的rdlc报告生成pdf。如何分配报告名称(.rdlc)和渲染时,错误

Hello every one, I want to generate pdf using rdlc report from class. How to assign report name (.rdlc) and while rendering, error

引用:

报告定义的来源尚未指定

the source of the report definition has not been specified



https://snag.gy/0WnIyA.jpg



请帮助我。

提前致谢



我的尝试:




https://snag.gy/0WnIyA.jpg

Please help me.
Thanks in advance

What I have tried:

Dim ReportViewer1 As Microsoft.Reporting.WebForms.ReportViewer = New Microsoft.Reporting.WebForms.ReportViewer()
     ReportViewer1.LocalReport.DataSources.Clear()
     ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote

     ReportViewer1.ServerReport.ReportServerUrl = New Uri("http://localhost:56370/NVSehore29jun18/")
     ReportViewer1.ServerReport.ReportPath = System.Web.Hosting.HostingEnvironment.MapPath("~/PartyFiles/General/ZSLedger001.rdlc")
     Dim rds As New Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", dt)
     ReportViewer1.LocalReport.DataSources.Add(rds)
     ReportViewer1.LocalReport.Refresh()

     bytes = ReportViewer1.LocalReport.Render("PDF", Nothing, mimeType, encoding, extension, streamids, warnings)

     Dim fs As FileStream = New FileStream(FilePath, FileMode.Open)
     fs.Write(bytes, 0, bytes.Length)
     fs.Close()

推荐答案

您应该验证RDL的路径(如果存在)。请将此讨论读作: c#4.0 - 来源尚未指定报告定义 - Stack Overflow [ ^ ]



PS:尝试调试代码,设置断点和进入你的代码,看看错误引发的位置。
You should verify the path to your RDL if it exist. Please give this discussion a read: c# 4.0 - The source of the report definition has not been specified - Stack Overflow[^]

PS: Try to debug your code, set a break point and step into your code to see figure out where the error is thrown.


这篇关于在ASP.NET类(而不是.aspx)中呈现rdlc报告时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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