简体   繁体   中英

Report Definition Local Definition Error

i have a very strange problem. i'm designing a winform app using C# and SQL. i have one reportviewer(its a local report) that is bound to a dataset that holds data of a select query. the report viewer is working ok in both release and debug modes, i'm able to view data, able to export it without any hindrances..

So i went ahead and published my app using Install shield, along with all my other forms. and made the setup file

i installed the setup file on my PC for testing purpose. All forms are working fine except the report viewer. when i click on my generate report button, the error "An error Occurred during Local Report Processing, the report Defination for Report2.rdlc was not specified. Could not find. C:\\Users****\\AppData\\Local\\Apps\\2.0\\C0AR0PT5.VRJ\\DBE8ENNT.GWW\\si..tion_61336ddcb5db67e9_0001.0005_09635aa1235e262b\\Report2.rdlc "

What could be the reason, its working in VS2012 in both Debug as well as release mode.

Please help, What could be the issue?

You should embed the report as a project resource. As it seems, your application expects the report's RDLC file to be present outside the application as a file on the disk.


On your comment "How do I do that?":

Set "Build Type" for the RDLC file in Visual Studio to "Embedded Resource" and then read this . I'd like to add that you need to add the full namespace.

Example: your RDLC file is "MyReport.rdlc" and it's in the sub-folder "reports" of a project with default namespace "com.example.MyFirstProject". Then you need to set ReportEmbeddedResource to

com.example.MyFirstProject.resports.MyReport.rdlc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM