How to Export Each page of report to seperate pdf files in Crystal Reports XI
Hi Guys,
I have a school report listing pupils marks for an entire grade. I have each pupils report on a separate page. However, when I export, I am only able to export to a single pdf file.
How can I export each page as a seperate pdf file?? is it possible?
Re: How to Export Each page of report to seperate pdf files in Crystal Reports XI
Unfortunately this is a common problem, you can export them all one at a time, which takes time, or what you can do instead is use a pdf splitter. What we use at work is this hxxp://www.pdf-explode.com/ it works great!
Re: How to Export Each page of report to seperate pdf files in Crystal Reports XI
• Please refer to the following VB.Net code for exporting to seperate pdf files.
• Dim rdoc As New ReportDocument
• '------------------------------------
• 'Add your code to set rdoc object
• '--------------------------------------
• Dim exportOpts As ExportOptions = New ExportOptions()
Dim pdfRtfWordOpts As PdfRtfWordFormatOptions = ExportOptions.CreatePdfRtfWordFormatOptions()
Dim destinationOpts As DiskFileDestinationOptions = ExportOptions.CreateDiskFileDestinationOptions()
For li_count As Integer = 1 To pagecount
pdfRtfWordOpts.FirstPageNumber = li_count
pdfRtfWordOpts.LastPageNumber = li_count
pdfRtfWordOpts.UsePageRange = True
exportOpts.ExportFormatOptions = pdfRtfWordOpts
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
destinationOpts.DiskFileName = "D:\report File" & li_count & ".pdf"
exportOpts.ExportDestinationOptions = destinationOpts
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
rdoc.Export(exportOpts)
Next
Please let me know the result.