I have a report viewer on the main window in a simple wpf application. Then I created, in the same solution, a class library project (MyReports.csproj) with a single report file (MyReport.igr). When I add this report to the report viewer as follows:
<ig:XamReportViewer Name ="xamReportViewer1">
<ig:XamReportViewer.RenderSettings>
<ig:ClientRenderSettings DefinitionUri="/MyReports;component/MyReport.igr" />
</ig:XamReportViewer.RenderSettings>
And then build the solution, and run it, I get this message:
could not find report definition /MyReports;component/MyReport.igr.
I have checked the report file properties and they are set to: Build Action = Resource and Copy to Output Directory=Copy Always. Interesting, if I create a report in the same project as the viewer, it always runs fine. When I create a report in a different project than the report viewer in the same solution, it never runs.
What am I doing wrong?
- Tom A.
Seems to be missing a reference from your MainProject to MyReports.csproj.
Am I right?
regards!
Simon
If my MainProject was named, "MainProject", what is the syntax for adding it as a reference?
="MainProject/MyReports;component/MyReport.igr" ??
="/MainProject.MyReports;component/MyReport.igr" ??
???
Simon,
Thanks, that did help.
I also wanted to say I really like the report model that NET Advantage reporting is built on. I've looked at the Xaml in the igr files and it looks clean (easy to read) and well organized.
My interest in the Xaml is focused on the possibility of programmatically writing an igr report, once my own reporting standards are organized. I think the ability to programmatically generate a file that would be the "first draft" of a report would be a great time saver.
Looking forward to additions to reporting product, specifically more charting/graphing capability. For now I am excited that the NET Advantage Reporting finally made it out of beta/ctp.
Hi,
There basically three things you have to check:
1- The report has "Resource" as Build Action. (In that case, you can select Do not Copy in the option "Copy to output Directory")
2- There is a reference from your WPF project to the Class Library Project that contains the report file
3- The URI in the viewer is correct
Here you will find more information about how to reference reports.
Because the things you wrote, I think the problem is the reference to the Class Library Project. Adding a reference in your WPF project to the Class Library, so it can find the assembly (dll), should solve the problem.
Please let me know if this helps.
regards,