Hello.
I'm using the WPF Reporting functionality to print a XamDataGrid and sometimes the printed output contains a blank last page. I'm not really sure why a blank last page is being printed (nothing in the visual representation of the grid indicates that a blank page should be printed), but I'm willing to live with that if there is some event that can be handled that will let me examine the output that's about to be printed and then decide if I want to allow the printing to happen. That way I could just prevent the blank last page from being sent to the printer. Does the WPF Reporting framework expose such an event?
Thanks
The only reason I could think that the last page could be blank is if you have a hierarchical grid where multiple pages are used to render a single set of rows.
e.g. Consider a structure such as the following:
ParentCell1 | ParentCell2 | ParentCell3 | ParentCell4 |
ChildCell1 | ChildCell2 |
Where when printed the cells of the parent row extent onto multiple pages horizontally and therefore the horizontal extent of the grid being printed is wide but the cells of the child record do not extent to multiple pages (or at least not to the last page that the parent row would). When the last row(s) being printed are that of the child records then nothing would be on the last page since none of its cells extent to that page.
If that is not the scenario that you are describing then I would recommend submitting a sample to the support group so the issue can be investigated.
I thought I replied to back to this post a while ago, but apparently I did not. :(
You were indeed right in your assessment of how we were using the grid to display hierarchical data, but our grid data was not as you described (having parent cells that extended across multiple pages horizontally). What worked for us to stop the blank last page from being prevented was the removal of the following line of code:
Report.ReportSettings.HorizontalPagintationMode = HorizontalPaginationMode.Scale;
I'm not sure why, but after that line was removed, the problem went away.