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
I've got the same problem. I'm trying to print an UltraGrid in an UltraPrintDocument with an UltraPrintPreviewDialog. The grid which I'm getting has a grey background (around the grid where no columns and rows are shown).
For printing, I want to set this area white for saving ink but all I tried didn't work.
I tried Gird.DisplayLayout.Appearance.BackColor = Color.White in nearly any event handler that could possibly fire - but nothing works. The area remains grey.
I've read in another post, that the initailize[Print]Layout won't fire, if I use the PrintPreviewDialog.showDialog(). The initializeRow event ist fired and I'm tried setting the color here (e.PrintLayout.Appearance... doesn't work here) but also no luck. Funny: Perfoming an auto layout for column width works here.
Is it possible to set a new PrintLayout for the Grid at runtime like :
dim tmp as UltraGridLayout = new UltraGridLayout()
tmp.isPrintLayout = true;
tmp.Appearance.BackColor = Color.White
????
Thanks, Christoph
Hi Valentina,
Well, I'm not sure if you can do this in different fonts, but it seems to me that you could use the TextCenter property for "INVESTMENTS" and then TextLeft for the other text below it. You just have to put some empty lines into the TextLeft so it's shifted down, I would think. Does that not work?
Mike,
I'm trying to use print controls to build a complex report, probably this wasn't so clear in my previous posts.
I succeeded in using UltraPrintPreviewDialog and UltraGridPrintDocument in a simplified environment, but in my real application I have to print a report which must consist of these parts:
. title (in strong and big font),
. summary section (in smaller font): it would be nice if the summary section could also contain the first grouping field used in the grid (the other ones can remain group-by row),
. grid (if the grid breaks in two pages, the summary must be repeated in each page),
. page numbers.
This is a sample of what I would like to print ('=' signs indicate page bounds):
======================================== INVESTMENTS Year: 2009 Month: April Agent: John Smith (this is a group-by field!) ----------------------------------------------------------------- | col1 | col2 | col3 | col4 | ----------------------------------------------------------------- | + group2 | | ... | ... | ... | ... | | ... | ... | ... | ... | | + group3 | | ... | ... | ... | ... | | ... | ... | ... | ... | ----------------------------------------------------------------- 2 =======================================
Could you please suggest me which Infragistics control I should use, whether UltraGridPrintDocument or Infragistics.Documents.Report, or another one...? I also would like to export the same content to pdf, so it would be better if I could reuse the same report-building code...
Thank you so much! bye, Valentina
HI Valentina,
jeanie77 said:(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...
Are you referring to the grid on the screen or the printout? I don't think the background of the grid actually prints. It would be a pretty big waste of ink for the printed page to be filled with a background color.
jeanie77 said:(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?
Can't you add a multiline text string the to the TextLeft section for this?
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