Support Article
Error when running sub report definitions
SA-9863
Summary
When using two sub-reports, an error occurs when running the main report.
Error Messages
Error:** ** An error occurred on generating the query for the report definition - null
Steps to Reproduce
1. Create a report definition which returns the count of all cases (this report returns only one row).
2. Create a second report definition which returns the count of cases which match a condition (this report returns multiple records based on conditions).
3. Create a third report definition which has the above two as sub reports. In the columns to include, use the functions, multiply and divide, to get the value as a percentage.
The first report (one with only one row returned) is configured as follows:
1. Number of rows returned from sub-report = "1 row".
2. Location where this sub-report is used = "Left hand side and right hand side of filter".
3. No filter condition as it always returns total number of cases.
4. The join is set as "Do not match rows".
The second report is set as follows:
1. Number of rows returned from sub-report = "More than 1 row".
2. Location where this sub-report is used = "Left hand side and right hand side of filter".
3. Filter is set on a property on the subreport.
4. The join is set as "Include only matching rows from both reports".
Root Cause
The sub-reports need to join the main report on a field, even if the sub-report has only one column.
Resolution
Add the required join to resolve the issue.
Published June 12, 2015 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.