Show sub-report header and footer when there is no data

Posted by: mfitzpatrick on 21 September 2017, 11:57 pm EST

  • Posted 21 September 2017, 11:57 pm EST

    I have a report with multiple sub-reports. These sub-reports use banded lists with groupings to show sub-totals of the grouped data in the footer. The problem I am having is if no data is returned from the sub-reports datasource, the sub-report is not printed.

    My requirement is to have the sub-report print with the header visible and the sub totals equal to zero in the footer when there are no detail records. Is there a way to have the header and footer print even if there is not data in the detail?

    Thanks

    Mike

  • Posted 25 September 2017, 3:01 am EST

    Hi Mike,

    I created a RDL report with BandedList with no records, I used this report as a sub report fot another rdl report. When I run the main report I see the GroupHeader and GroupFooter is printed even if there is no data in the BandedList detail.

    Please make the changed to the attached sample reports and send it back to me so that I can further debug it at my end.

    Thanks,

    Deepak SharmaBandedListSubReport.zip

  • Posted 26 September 2017, 4:07 am EST

    Hi Deepak,

    Thanks for the response.

    Looks like your query was ```

    SELECT NULL FROM CustomerOrders

    
    I don't know why that works, but it does not accurately reflect my results.
    
    I have updated the query to ```
    SELECT * FROM CustomerOrders where AccountNumber = 'asdasdasad'
    

    This is a more realistic test for my issue. Now the data set yields no results and the sub report does not render on the main report. I have attached your reports with changes to make the sub report not print

    I was wondering if there is a way to print the header and footer of the banded list for the sub report. Example: The header has column labels and the footer has totals. I want to print the column labels in the header and 0’s in the footer if the results yield no detail records. This would indicate to the user that the sub report had empty results, but is not missing from the report.

    Thank you

    Mike

    BandedListSubReport.zip

  • Posted 26 September 2017, 10:44 pm EST

    Hi Mike,

    I am able to replicate the issue now , it looks like a default behavior to me. However I have escalated the same to the development team. The tracking id for this issue is #246366.

    I will let you know as soon as I hear anything on this.

    Thanks,

    Deepak Sharma

  • Posted 4 October 2017, 6:31 pm EST

    Hi Mike,

    Our developer has suggested to to create the stored procedure for subreport to return the row with nulls if main query does not return any data.

    Let me know in case this does not work either.

    Thanks,

    Deepak Sharma

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels