I’m trying to print a TableView and I have some problem with headers and footers. My grid has many columns and doesn’t fit nicely to a single page. So I use link.VerticalContentSplitting = VerticalContentSplitting.Smart; to have the grid arranging the column on two pages.
The header and footer are bound to UsablePageWidth but in this case it is incorrect and I don’t know how to fix it.
This happens also if I use the scale button on the Print Preview.
I have modified a sample to show this behavior.
Thank you for the sample project. The "Smart" vertical content splitting does not work here as columns are not aligned with elements that you add to the PageHeader / PageFooter area. As it is impossible to move a column to the next page without cutting that extra element in half (the opposite is true as well), the original layout remains. As for the UsablePageWidth property, it returns the width of a single page excluding side margins, not the width of the printed grid. The only workaround I can suggest here is to apply your templates to the document's top/bottom margin area.
If that does not meet your goal, or if you'd like to get ultimate control over the print output, I suggest that you produce it with the help of our reporting tools (converted by your subscription). If that's something you've never had to deal before, please check our help documentation: Get Started with DevExpress Reporting. Naturally, reporting is a separate product which is different from the GridControl's built-in printing engine. Lucky, it is not necessary to create the same tabular report (Create a Table Report) from scratch as there is a generator available: Grid-Based Report Generation.
Please try it and let us know how it works for you.