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
115
Printing of grids
posted

Hi Mike,

 

we are still porting a grid implementation with Farpoint to Infragistics UltraGrid. Currently we have problems using the print functionality.

Our reports should have a header and a footer with simple text statically for all pages of the report. In between of the header and footer, we calculated a region for the grids and plots to be printed. The problem is: without printing the grid into the report all is fine, for tests we printed a simple rect and header and footer and all is placed correctly on the pages.

But when printing the grid the headers are spread so that they are too broad for the page and do not fit any more. Also the footers, which are no more visible because they are located outside of the page.

Our implementation is the following:

  1. In OnPrintPage the margins are calculated using the PrintpageEventArgs this calls PrintRegionRectangle
  2. In PrintRegionRectangle
    1. an Infragistics.Documents.Reports.Graphics is created from System.Drawing.Graphics Object
    2. an Infragistics.Documents.Reports.Report  is created
    3. Into this report an Infragistics.Documents.Reports.Report.Section section is created
    4. The section object is used to create a Header and a Footer (using AddHeader and AddFooter Methodcalls). Header and Footer objects are configured with Text-Objects (Infragistics.Documents.Reports.Report.Text) which are configured with font, size, alignment etc.
    5. The Grid is printed into the Section using the UltraGridDocumentExporter
    6. Finally graphics is scaled to fit to the page, then the report draws into the graphics

 

Why is the complete layout of the page changing, when the grid is printed into the section? Margins are different, footers are no longer visible. Moreover we did not find a way to configure the Grid so that it is shown in good readable scale (it is too small even if there is a lot of space on the page). Do you have a sample for this and a documentation how to use Report, Section and UltraGridDocumentExporter?

Thanks

Wolfgang & Alex

Parents Reply Children