SAP Knowledge Base Article - Public

2295317 - Blank lines added for each suppressed subreport when exporting a report to Text format from Crystal Reports

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 from Crystal Reports to text format, 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 designer.

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.
  2. Insert a subreport on the report.
  3. Link the subreport to the main report.
  4. Format the subreport with the option: "Suppress Blank Subreport".
  5. Check the option "Suppress Blank Section", for the section in which the subreport is located.
  6. Export the report to Text format.
  7. 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.
      
    Blank Subreport - 02.png
     

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 BusinessViews Manager , Problem

Product

Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016