Save Each PreparedPage to Individual Pdf with Specific Name From Each Page

  my customised code was written with great help from dear friend ipong;

https://forum.fast-report.com/en/profile/ipong

 FastReport.Preview.PreparedPages prpPages = Report.PreparedPages;

   int pageCount = prpPages.Count;


   for (int i = 0; i < pageCount; i++)

   {

    ReportPage objPage = prpPages.GetPage(i);   

    TableCell StudentCode_cell=(TableCell)objPage.FindObject("Cell64");

    TableCell StudentName_cell=(TableCell)objPage.FindObject("Cell55");

     

    using (FastReport.Report reportExport = new FastReport.Report())

    {

     using (MemoryStream stream = new MemoryStream())

     {

      prpPages.Save(stream);

      stream.Position = 0;


      reportExport.LoadPrepared(stream);


      for (int j = pageCount - 1; j >= 0; j--)

      {

       if (j != i)

        reportExport.PreparedPages.RemovePage(j);

      }


      using (FastReport.Export.Pdf.PDFExport pdf = new FastReport.Export.Pdf.PDFExport())

      {

       pdf.ShowProgress = true;

       pdf.OpenAfterExport=true;

       pdf.EmbeddingFonts = true;

       pdf.Compressed = true;

       pdf.AllowPrint = true;

       pdf.Export(reportExport,"d:\\"+ StudentCode_cell.Text+StudentName_cell.Text+".pdf");

      }


     }


    }


   }

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.