Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
543
Customizing UltraGrid print preview
posted

Hi all,

I would like to print and print preview the content of an UltraGrid control that is shown on a form. The grid holds financial data with summaries, totals, etc.

To show the print preview I used an UltraPrintPreviewDialog, bound to an UltraGridPrintDocument, whose grid is set to the UltraGrid control.

Then I used grid's InitializePrint event handler to customize print layout of the grid (row selectors, colors, shown columns). Here I also would like to change two background colors that I'm not able to find in 'e.PrintLayout.Override' property: the color for the area that in AppStylist is called 'GridControlArea', and the color of grouped rows (that can be expanded or collapsed with '+' or '-' sign). What property should I use to change that colors?

And also, I need to post another question...

On the top of each printed page, just below document's header (title), I would like to print some summary rows to complete my report with additional informations (company name, used filters, etc.). Is it possible to add a little section, to be repeated in all pages just like the title?

Thank you very much, Valentina

 

  • 69832
    Suggested Answer
    Offline posted

    jeanie77 said:
    the color for the area that in AppStylist is called 'GridControlArea'

    See e.PrintLayout.Appearance.BackColor

    jeanie77 said:
    the color of grouped rows (that can be expanded or collapsed with '+' or '-' sign).

    See e.PrintLayout.Override.GroupByRowAppearance

    jeanie77 said:
    s it possible to add a little section, to be repeated in all pages just like the title?

    The Infragistics.Win.Printing.UltraPrintDocument class derives from System.Drawing.Printing.PrintDocument; there is an overload of the grid's PrintPreview method that allows you to specify a PrintDocument, so what you can do is create an UltraPrintDocument and pass that instance to the Print/PrintPreview method. In the InitializePrintPreview/InitializePrint event handlers, upcast the e.PrintDocument to an UltraPrintDocument, and then you can set the Header/Footer properties (for example, TextLeft, TextCenter, TextRight).