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
1075
Exporting multiple grids to one pdf
posted

 Hi!

I have a grid and I need to print to pdf different views of this grid (using different filters).

So I do like this:

Report report = new Report(), report2 = new Report();

            this.ultraGridDocumentExporter1.Export(this.gridViewWaste, report);
            report.Publish(@"C:\Temp\mila.pdf", Infragistics.Documents.Report.FileFormat.PDF);
            // I am changing grid filters and visible columns here)

            this.ultraGridDocumentExporter1.Export(this.gridViewWaste, report);
            report.Publish(@"C:\Temp\mila2.pdf", Infragistics.Documents.Report.FileFormat.PDF);

 

As a result - both pdfs are the same and contains first view of the grid. If I export grid after filtering to report2 and publish report2 to mila2.pdf - mila.pdf and mila2.pdf contains two different views of the same grid as it is supposed to be. How to get those two views in the same pdf?

Parents
  • 37774
    Verified Answer
    posted

    I'm not sure I understand your question.  You can export different grids to the same report by passing in an ISection to the exporter, such as:

    Report report = new Report();
    ISection section = report.AddSection();
    this.ultraGridDocumentExporter1.Export(this.ultraGrid1, section);

    section = report.AddSection();
    this.ultraGridDocumentExporter1.Export(this.ultraGrid2, section);

    If your grid layout is pretty simple, you could even export it to the same section, though you may be better off doing it as I posted here.

    -Matt

Reply Children
No Data