Hello,
I am using XamDataGrid and try to print it using PrintReport.
I create a report and add my grid within a EmbeddedVisualReportSection. Everything is ok excepted two columns which display listbox. Print generates ScrollBar and i don't want this behavior.
Is it possible to ask XamDataGrid to fit cell's and column's content to get a readable print document ?
Thank's in adavance.
You can change the pagination mode to scale so the report scales and fits all fields onto a single pagereport1.ReportSettings.HorizontalPaginationMode = HorizontalPaginationMode.Scale;
No it doesn't work.
My two columns still display contained list box with scroll bar instead of fit the list box size and so show all data.
Is there any other solution ?
Regards.
Could you post some screenshot so I can see the scrollbars?
Thanks,
Here is a screen shot of the XPS viewer.
I deleted confidential data. As you can see, scroll bar still remain.
I give you the code-behind thaht generate this print :
Report ret = new Report();
EmbeddedVisualReportSection section = new EmbeddedVisualReportSection(MyGrid);
ret.Sections.Add(section);
ret.ReportSettings.HorizontalPaginationMode = HorizontalPaginationMode.Scale; ret.ReportSettings.PageOrientation = PageOrientation.Landscape;
Thank you for your help ;)
These scrollbars are related to the nested ListBox elements in the last field. One option is to increase the width of the last field or hide the scrollbars by setting:
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"..
Hope this helps