Symptom
- Blank lines added to the text file.
- Exporting a report to text format that contains a subreport, generates extra blank lines between rows of data.
- When exporting to text format from Crystal Reports, a report that contains a subreport in a section with the following formatting options checked:
- Suppress Blank Subreport
- Suppress Blank Section
It generates a blank line in the text file for the instance where the subreport is blank, despite the whole section is suppressed in Crystal Reports.
- Note: Images and data in this SAP Knowledge Base Article is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
Reproducing the Issue
- In Crystal Reports, create a report off any data source.
- Insert a subreport on the report.
- Link the subreport to the main report.
- Format the subreport with the option: "Suppress Blank Subreport".
- Check the option "Suppress Blank Section", for the section in which the subreport is located.
- Export the report to Text format.
- Open the text file generated.
Notice it generates a blank line in the text file for the instance where the subreport is blank, despite the whole section is suppressed in Crystal Reports designer.
In the following example, the subreport is located in Details b section, and for line 6 and 7, the subreport is blank, and it is therefore suppressed on the report.
But in the exported text file, it add a blank line after line 6, and after line 7. See the blank line numbered in red in the text file output.
Cause
- The Suppress Blank Subreport option is unfortunately not supported when exporting to Text format from Crystal Reports, and this is why a blank line is added to the generated text file when the subreport is blank.
Resolution
- The suggestion to not export a blank line when a subreport is blank are:
- Export the report to a different format, like: PDF format; or
- Export the report to Text Format from Crystal Reports for Enterprise.
- Note: The reason the option "Suppress Blank Subreport" option is supported in Crystal Reports for Enterprise, it's because the text exporting driver was enhance to a Page base export. This means it analyze the whole page before exporting the content, and therefore it is able to support the "Suppress Blank Subreport" option.
But in Crystal Reports, the text exporting driver is a Record base export. This mean it export the data line by line, so it has to generate one line before exporting the content of the line. It is not possible to know in advance the subreport is blank, until it is evaluated, and the line has already been added. It is a limitation of the Record base exporting driver. Same situation will occur when exporting to MS Excel - Data Only format, as it is also a Record base exporting driver.
Keywords
CR, Export blank lines, Exporting to Text , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020