MTL999
asked on
Subreport fails when its stored procedure does not return any data, otherwise ok
Hello,
I have a subreport that is using a sql server stored procedure as its source. When the sp returns data, the report works fine. If it has no data to return, the report fails with the message below.
How do I get around that ? I tried page suppression via section expert but without any luck.
Error - ExportReportToDisk: One or more fields could not be found in the result set. Use Verify Database to update the report.
Failed to export the report.
Error in File brm_ecn 4224_5880_{0A81305B-6030-4 6E1-8C30-8 C35C1AB446 4}.rpt:
The rowset column could not be found.
Cheers
Bruno Campoli
I have a subreport that is using a sql server stored procedure as its source. When the sp returns data, the report works fine. If it has no data to return, the report fails with the message below.
How do I get around that ? I tried page suppression via section expert but without any luck.
Error - ExportReportToDisk: One or more fields could not be found in the result set. Use Verify Database to update the report.
Failed to export the report.
Error in File brm_ecn 4224_5880_{0A81305B-6030-4
The rowset column could not be found.
Cheers
Bruno Campoli
ASKER
I tried that but same result... It just seems that since nothing is being return, it still tries to map the expected data.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You ! I did a select top 1 col1, col2 from tablea where 1 = 2. That did the trick. It returned the row header without rows..
If this is SQL Server, use SET NOCOUNT ON in the SP definition.
If this is a different DBMS, look for a similar option.