I have a UserControl with 4 DataGrids stacked one below the other within a StackPanel. All are same width but different heights and some have scrollbars. The grid widths are slightly wider than the printer page's landscape width.
I want to print all the 4 grids within the StackPanel, with all data in them and only the width of the grids rescaled to fit my page.
I tried adding the entire StackPanel as a section [report.Section.Add(MyStackPanel)] but this only prints 1 page, the un-scrolled data in the grids is not printed and also my last grid column gets truncated.
I tried setting HorizontalPaginationMode to Scale, but maintaing aspect ratio messes things up.
I tried adding individual grids as sections but then each grid is printed on separate pages.
Please help. Thanks.
Hi,
I don’t know if you’ve had an opportunity to review the information I provided.
Please let me know if there is anything further that I can help you with regarding this question?
Sorry for the delay in responding. One of the benefits of using a xamDataGrid as the control embedded in the EmbeddedVisualReportSection section is that the xamDataGrid already implements the IEmbeddedVisualPaginator.
You initially mentioned that you had multiple xamDataGrids that were in a StackPanel, which would mean that you would have to implement the IEmbeddedVisualPaginator for the StackPanel. Not a simple task.
One alternative would be to use a single xamDataGrid and then create multiple layouts; each layout would need to handle what you not have in one of your grids.
When adding multiple EmbeddedVisualReportSection, each section would begin on a separate page, even though there might be available space.
As for the flow of pages, have you seen this document? It may be helpful to you.
http://help.infragistics.com/Help/NetAdvantage/WPF/2012.2/CLR4.0/html/InfragisticsWPF4.Reporting.v12.2~Infragistics.Windows.Reporting.Report~ReportSettings.html
Please let me know if you have any questions.
Not received any assistance regarding this as yet. Please help.
Basic questions:
1.) How to print multiple sections added to Report continuously - without page breaks.
2.) Scale DataGrid only horizontally; vartically, let it flow into next page.
If there is some example that shows printing a UserControl with multiple datgrids, please post it for me to look at.
Thanks.
My Current Code for reference:
Report report = new Report();
report.ReportSettings.Margin =
new Thickness(20, 20, 20, 20);
report.ReportSettings.PageOrientation =
PageOrientation.Landscape;
report.ReportSettings.PagePrintOrder =
PagePrintOrder.Vertical;
report.ReportSettings.HorizontalPaginationMode =
HorizontalPaginationMode.Mosaic;
EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(MainStackPanel);
report.Sections.Add(section);
report.Print(
true, false);