Link to home
Start Free TrialLog in
Avatar of MTL999
MTL999Flag for Canada

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-46E1-8C30-8C35C1AB4464}.rpt:
The rowset column could not be found.

Cheers
Bruno Campoli
Avatar of Ido Millet
Ido Millet
Flag of United States of America image

Perhaps it's because the SP returns the count of records.
If this is SQL Server, use SET NOCOUNT ON in the SP definition.
If this is a different DBMS, look for a similar option.
Avatar of MTL999

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
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MTL999

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..