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
jeanie77 said:the color for the area that in AppStylist is called 'GridControlArea'
jeanie77 said:the color of grouped rows (that can be expanded or collapsed with '+' or '-' sign).
jeanie77 said:s it possible to add a little section, to be repeated in all pages just like the title?
Hi Brian,
thank you for the quick response. I tried your suggestions and here are my questions:
(1) e.PrintLayout.Appearance.BackColor: I'm afraid, this doesn't produce any changes... grid's background (inside the grid, the flat panel on the right, after the last column, like the black banner here in this forum) remains 'light blue' as usual...
(2) e.PrintLayout.Override.GroupByRowAppearance.BackColor: ok it worked! :)
(3) (summary section): I've already used UltraGridPrintDocument.Header.TextCenter property to set report's title. What I need to do now is adding an additional left-aligned six-rows section, that remains below the title line and has a different visual style. Is it possibile with an UltraGridPrintDocument+ UltraPrintPreviewDialog or with the solution you suggested?
Thanks a lot, bye Valentina
Hi Christoph,
Mike suggested me that the background shown in print preview will not actually print. It is only a display-feature, I think. In fact in my printed version of the grid the background is not visibile...
Anyway I think it could become a strange behaviour for the user, showing a blue (or grey, in your case) background on the screen, and not in the printed paper. But I don't believe this point to be very relevant at last...
Bye, Valentina
Hi Valentina,
thanks for your response. In fact, in my printed document the background is visible. :(
Bye, Christoph
Can you post a small sample project demonstrating this? I'm afraid I have no guess as to why that's happening for you. As I said above, it doesn't make any sense for the grid to print a background color outside the cells - it would just be a big waste of ink.
Hi,
a style was overriding the background for the grid - even in the print view.
Defining a new style (or using another style that's defining white background) and setting the grids style to this one makes the background white. So for all having the same problem:
UltraGrid1.StyleLibraryName = "LibraryName"
could help you out.
Thanks for your help...
thank you for your suggestion.
It would be nice if in their next release, Infragistics staff would provide a way for an UltraGrid to support different styles for both presentation and print layouts. Just like html web pages, that can be customized to have a separate css for 'printer friendly' version of the page.
Now it is only partially supported, using e.PrintLayout, because we aren't able to override all the settings in the default layout.