We have a multipage FlowDocument report that we are developing in WPF that uses charts. When we view the FlowDocument we can see the charts, however when we print the flowdocument the charts do not show on the printed material (we tried printing to different printers including pdf documents, xps document, actual printed paper).
We have found that, if we manually page through the FlowDocument (look at each page) and then print, the charts show in the printed material. It's almost as if the charts need to be viewed or displayed before they can be printed.
I would like to get to the point where I do not need to view the FlowDocument and just print the report in batch.
As for printing .... here is the code that I'm using to print the FlowDocument
PrintDialog printDialog = new PrintDialog();
if (printDialog.ShowDialog() == true)
{
FlowDocument mainFlow = m.mainFlow;
// Save all the existing settings.
double pageHeight = mainFlow.PageHeight;
double pageWidth = mainFlow.PageWidth;
// Make the FlowDocument page match the printed page.
mainFlow.PageHeight = printDialog.PrintableAreaHeight;
mainFlow.PageWidth = printDialog.PrintableAreaWidth;
// Reapply the old settings.
mainFlow.PageHeight = pageHeight;
mainFlow.PageWidth = pageWidth;
IDocumentPaginatorSource ps = mainFlow as IDocumentPaginatorSource;
printDialog.PrintDocument(ps.DocumentPaginator, "FlowDoc");
}
Paul,
I'm referring to the next availalable service release.
http://ko.infragistics.com/support/service-releases.aspx#ServiceReleases
-Graham
I have not seen a recent service release and I have an ongoing support case for this problem. I have not been notified that there is a fix available.
Which specific service release includes the fix and where can we download it from?
Thanks ... Paul
This bug is resolved in the latest service release, but when you are doing measure/arrange before printing you must also call UpdateLayout to make sure that the layout has been synchronously updated, or there may be pending work to make the chart presentable.
A workaround that might help you in the meantime is to attach control to the live tree and perform measure, arrange, and then updatelayout, and then detach the chart. I don't believe you have to let the chart actually display to get this to work, it should be enough if the chart's loaded event fires.
Let me know if this helps.
I am interested in a solution to this problem as well.
Bug number is 60336, I will get back to you if I can find any work around. Unfortunately the error that was introduced before the service release may be more difficult to work around than the original problem was.