TheUndecider
asked on
Suppress Exporting Crystal Report as PDF IF No Data
Hello,
I batch export several Crystal Reports as PDF using a VB.NET 2003 Windows application. However, since I am exporting to PDF and not printing, I cannot suppress if there are no records anymore. The property the report has to suppress printing if no data doesn't apply to exporting as PDF. Therefore, I end up with several PDFs that are blank because they did not have any records.
I'm using the ReportDocument (CR) class and the CR.ExportOptions process to export. Here's a sample of what I do after the report is ready to be exported.
Dim CR as New ReportDocument
..
..' provide path to open the report and enter parameters here too.
With CrExportOptions
' Set the destination to a disk file
.ExportDestinationType = ExportDestinationType.Disk File
' Set the format to PDF
.ExportFormatType = ExportFormatType.PortableD ocFormat
' Set the destination options to DiskFileDestinationOptions object
.DestinationOptions = CrDiskFileDestinationOptio ns
.FormatOptions = CrFormatTypeOptions
End With
' Export the report to the PDF folder path
CR.Export()
Is there a way to stop the exporting process if the report is blank or has no records? I was hoping to use something like size property, but I can't find it.
Any help would be tremendously appreciate it.
I batch export several Crystal Reports as PDF using a VB.NET 2003 Windows application. However, since I am exporting to PDF and not printing, I cannot suppress if there are no records anymore. The property the report has to suppress printing if no data doesn't apply to exporting as PDF. Therefore, I end up with several PDFs that are blank because they did not have any records.
I'm using the ReportDocument (CR) class and the CR.ExportOptions process to export. Here's a sample of what I do after the report is ready to be exported.
Dim CR as New ReportDocument
..
..' provide path to open the report and enter parameters here too.
With CrExportOptions
' Set the destination to a disk file
.ExportDestinationType = ExportDestinationType.Disk
' Set the format to PDF
.ExportFormatType = ExportFormatType.PortableD
' Set the destination options to DiskFileDestinationOptions
.DestinationOptions = CrDiskFileDestinationOptio
.FormatOptions = CrFormatTypeOptions
End With
' Export the report to the PDF folder path
CR.Export()
Is there a way to stop the exporting process if the report is blank or has no records? I was hoping to use something like size property, but I can't find it.
Any help would be tremendously appreciate it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Computer101
EE Admin