1213091 - Subreport returns no data in Crystal Reports, despite it should return data

SAP Knowledge Base Article - Public

1213091 - Subreport returns no data in Crystal Reports, despite it should return data

Symptom

  • Blank report.
  • Report with linked subreport(s) are blank, but subreports with no links returns data.
  • Unable to drill-down on a blank subreport in Crystal Reports when the main reports returns no data.
  • How to automatically display subreport data when the main report returns no data, or when the main report has no data source?

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 new report with no data source.
    ( The main report will be used as a container of one or more subreports. )
  2. Suppress all the sections of the report except the Page Header, Page Footer, and Report Footer.
  3. Insert one or more subreport on the report. For example, in the Report Footer section.
  4. Create parameter on the main report.
  5. Link the main report parameter to the subreport(s)
  6. When refreshing the report, it returns nothing. It is blank.

Cause

  • The reason this situation occurs, it's because the main report does not have a data source, and therefore it will not be executing subreports that are linked because the subreport depends on the main report, and since there is no data on the main report, the subreport will not be executed.

Resolution

  • When a report contains linked subreport(s), the main report needs to return at least one record for the subreport(s) to be executed.
    To ensure the main report returns at least one record on the main report:
      
    1. Add a data source connection to the main report, and add one table that returns at least one record.
      ( If the table return more than one record, you can create a record selection that filter the data to return one or few
         records, as the main purpose is not to return a lot of records, but to have at least one record on the main report. )
        
    2. Place a database field into the details section of the main report.
       
    3. Suppress the Details section.
        
    4. Now, when refreshing the report, it will always execute the linked subreports.
         
         
  • Another option will be to set the subreport to be on-demand. This option really depends on the report specifications and desired behavior, but even if the main report returns no data, with an on-demand subreport, it will be possible to double click on the subreport and run it.
       
    1. Right click on the subreport, and select "Format Subreport..."
       
    2. In the "Format Editor", under the tab "Subreport", check the option "On-demand Subreport"
         
    3. Click "OK" to accept the change.

Keywords

SUBREPORT NO RECORDS BLANK LINKING DOUBLE CLICK DISPLAY Seagate Crystal Reports Seagate Info Subreports , CR , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

Crystal Reports 2008 V0 ; Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports XI R2