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
260
UltraGridDocumentExporter PDF Column Cut-off
posted

Hello,

 

I'm using the UltraGridDocumentExporter to export a grid to pdf.  The grid has a potential 3 bands.  On export to pdf, all bands are expanded, and shown.   There are two problems with how this is happening now.

 

1) The columns are not matching up in the pdf .  It seems as though by expanding out all child bands the column alignment gets wonky (i.e. the header columns don't match the columns in the grid.)

 

2) If the report is more than one page long, (and regardless of the number of columns) the 2nd page's right most column is cut off.

 

Below is the code.

 

               UltraGridDocumentExporter exporter = new UltraGridDocumentExporter();
               
                ////prep grid
                ////hold on to the old one for a bit

                //string xml = RemoveAllGridGroups(ref grid);               

                Report report = new Report();
                ISection section = report.AddSection();

                PageSize pgSize = new PageSize(11, 8.5F);
                section.PageSize = pgSize;

                // Set the page orientation
                section.PageOrientation = PageOrientation.Portrait;

                //// Set the page orientation  // where broker expands on an interface for any object that provides

////the data that would be bound to  a UltraGrid


                IText text = section.AddText();
                if (!(broker.PdfReportOptions.ReportCaption == null
                                || broker.PdfReportOptions.ReportCaption == ""))
                {
                    headerText = broker.PdfReportOptions.ReportCaption;
                }

                text.AddContent(headerText,
                                new Style(new Font("Verdana", 25),
                                          Infragistics.Documents.Graphics.Brushes.Black));

                text.AddLineBreak();

                IText dateText = section.AddText();
                dateText.AddDateTime(@"MM/dd/yyyy");
                dateText.AddLineBreak();
                dateText.AddLineBreak();

                text.Alignment = TextAlignment.Left;
                dateText.Alignment = TextAlignment.Left;


                // Add the grid content to this section
                exporter.Export(grid, section);
               
 

                // Add a footer. We need this to ensure that that the report content does not
                // go outside the printable area.
                ISectionFooter footer = section.AddFooter();
                footer.Height = 130;

                // Page numbering
                Infragistics.Documents.Report.Section.PageNumbering pn = section.PageNumbering;
                pn.Template = "Page [Page #] of [TotalPages]";
                pn.SkipFirst = false;
                pn.Alignment.Horizontal = Infragistics.Documents.Report.Alignment.Right;
                pn.Alignment.Vertical = Infragistics.Documents.Report.Alignment.Bottom;
                pn.OffsetX = -90;
                pn.OffsetY = -115;


                // Set the file path for the report
                string Temp = Environment.GetEnvironmentVariable("TEMP");
                string fullPath = Temp + "\\" + pdfName + "_" + String.Format("{0:MMddyyhmmss}", DateTime.Now) + ".PDF"; //"\\Portfolio.xls";
                //exporter.Export(grid, fullPath, GridExportFileFormat.PDF);


                // Publish the report
                report.Publish(fullPath, FileFormat.PDF);

                // Launch the report
                Process.Start(fullPath);

 

Thanks in advance for any help.

Parents
No Data
Reply
  • 7566
    Suggested Answer
    posted

    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

    Hello ,

     

    It has been a while since you have made your  post, in case you still need of support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well.  So I am attaching a sample with our latest build which reproduces this scenario. The sample includes three UltraWebGrids exported with an UltraWebGridDocumentExporter.

     

    I hope this information is helpful.

     

     

    Sincerely,

    Georgi Sashev

    Developer Support Engineer

    Infragistics, Inc.

    http://ko.infragistics.com/support

    69380(PDF Export).zip
Children
No Data