Hey there, i want to include a chart in my report. Therefore i created a UserControl containing all layout stuff i want to have in my xps/print. It is just a simple line-chart and in the constructor i bind to sample data. If i display this control in a "real" window
<infragisticsChart:UserControl1 x:Name="MyTestInstance"/>
and then print it
var reportObj = new Report();reportObj.Sections.Add(new EmbeddedVisualReportSection(MyTestInstance));reportObj.Export(OutputFormat.XPS, "c:\\temp\\test.xps");
everything is fine. However, if i want to render the xps without having it in a real wpf window / page, the chart is not rendering anything. If i do
var reportObj = new Report();reportObj.Sections.Add(new EmbeddedVisualReportSection(new UserControl1()));reportObj.Export(OutputFormat.XPS, "c:\\temp\\test.xps");
I tried setting the size, InvalidateMeasure, InvalidateVisual and other things on the control, but it is just not rendering the chart.
The question is: How can i create a report with a chart on a console app / server / service? How do i tell / force a Chart to do its calculations and actually generate the view?
Thanks
Hello Martin,
Thank you for your post. I have been looking into it and I can say that the reports work with visual elements, which means that they should be in the visual tree of the application.
Hope this helps you.
Thanks for your answer. So am i right, that there is NO way to build a non-graphical Windows-Service that generates reports? I mean, if there is no visual tree? This would be a fairly large restricton...