FlexReport: Export to PDF or PDF/A Format

Export to PDF or PDF/A format from FlexReport requires either a bit of code, or specifying a few settings in a dialog box. PDF/A format is especially useful for large reports that you might want to send to coworkers as a digital file, instead of printing and distributing it. To export a report to PDF using the C1FlexReport object:

Export to PDF in Visual Basic


'create report object  
Dim C1FlexReport1 As New C1FlexReport()  

'Load a report  

C1FlexReport1.Load("..\\..\\Report\\Report.flxr", "Products Report")  
C1FlexReport1.Render()  

'Create PdfFilter object  
Dim filter As New C1.Win.FlexReport.PdfFilter()  

filter.ShowOptions = False  

'Give file name and path where exported file will be saved  
filter.FileName = "Products Report" + "..\\..\\ProductsReport.pdf" 'The report is exported as ProductsReport.pdf in bin\\debug folder  

'Export  
C1FlexReport1.RenderToFilter(filter)  

Export to PDF in C


//create report object  
C1FlexReport c1FlexReport1 = new C1FlexReport();  

//Load a report  

c1FlexReport1.Load(@"..\\..\\Report\\Report.flxr", "Products Report");  

c1FlexReport1.Render();  

//Create PdfFilter object  
C1.Win.FlexReport.PdfFilter filter = new C1.Win.FlexReport.PdfFilter();  

filter.ShowOptions = false;  

//Give file name and path where exported file will be saved  
filter.FileName = "Products Report" + @"..\\..\\ProductsReport.pdf"; //The report is exported as ProductsReport.pdf in bin\\debug folder  

//Export  
c1FlexReport1.RenderToFilter(filter);  

Export to PDF/A from the FlexReportDesigner

  1. Run the C1FlexReportDesigner application.
  2. Open your report.
  3. Click File|Export, or click Preview.
  4. From the Export group, select PDF/A from the PDF icon's dropdown. The Export Report to File dialog box opens.
  5. Specify your file name, and the type of file you want to save. PDF/A is selected by default.
  6. Click Save. The Save as PDF dialog box opens.
  7. Use the dialog box to set general document settings, security options, and apply or remove restrictions to your file.
  8. Click OK. Your exported PDF/A file opens in your PDF viewer.

Read more about FlexReport >>

GrapeCity

GrapeCity Developer Tools
comments powered by Disqus