I'm using XamReportPreview for generating a reports from user controls. When my report is over 10 pages calling GeneratePreview an Out of memory exception is thrown.
I've noticed a few posts regarding this with suggestion to submit a post for development with no solution.i.e. below posted 7 years ago.
www.infragistics.com/.../xamreportpreview-crahses-and-throws-out-of-memory-exception
Can someone please provide a solution?
Thanks,
Cristina
Hello Christina,
Thank you for contacting Infragistics. Which version of Infragistics are you using? I attempted to reproduce this behavior by printing an 11 page report generated from a XamDataGrid, however it worked as expected.
Please test, modify and reattach my sample with any necessary changes to isolate the behavior and I will investigate this further.
Let me know if you have any questions.
3010.WpfApp1.zip
Hello Michael,
I'm using 17.2
Thanks
Hello Cristina,
Thank you for following up. I attempted to reproduce this but was unsuccessful, please see sample below. The report generates the preview with 14 user controls. Please modify my sample or provide the xaml/designer code for given UserControl.
Note, I am using a PC with 16gb of ram. How much ram are you testing your application with?
3240.WpfApp1.zip
Hi Michael,
In my case, I'm generating a report that has 14 user controls (not datagrids.. each usercontrol is an entire page with many fields, expanders, datagrids) . In production will be more. Each user control is added
report1.Sections.Add(new EmbeddedVisualReportSection(myUserControl1));
report1.Sections.Add(new EmbeddedVisualReportSection(myUserControl2));
....
report1.Sections.Add(new EmbeddedVisualReportSection(myUserControl14));
xamReportPreview1.GeneratePreview(report1, false, false); // Out Of Memory Exception is throws here
Hope you can suggest a solution.
Cristina.
Thank you for following up. I retested my sample above with the latest Service Release for 17.2 aka. build 2077 and received similar results. Everything worked as expected and no exception occurred.
Let me know if you are able to reproduce the behavior or not using this version.