Print Page | Close Window

subreport data not showing from stored procedure

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15394
Printed Date: 20 Apr 2025 at 1:16am


Topic: subreport data not showing from stored procedure
Posted By: praveenhotha
Subject: subreport data not showing from stored procedure
Date Posted: 18 Jan 2012 at 12:08am
I have a crystal report with multiple sub reports, the data to the subreports is being passed from a stored procedure which returns to datasets.
I need to group the data based on a parameter in the main report.
When I try to group the data in the sub report based on same parameter. It gives me a invalid grouping error. Can anyone please refer me to a link which has some explanation about such problem.
I am able to view the report in preview mode, but when I fire the report, it throws me the above error.

I am assigning the datasets to the sub reports as shown below.

doc.SetDataSource(dstReport.Tables[0]);
                        doc.Subreports[0].SetDataSource(dstReport.Tables[0]);
                        doc.Subreports[1].SetDataSource(dstReport.Tables[0]);
                        doc.Subreports[2].SetDataSource(dstReport.Tables[1]);



Replies:
Posted By: lockwelle
Date Posted: 18 Jan 2012 at 3:27am
the only thing that comes to mind is if the field that you are grouping on is in the dataTable that you are setting the subreport to....or if the name is changed in your dataTable that is pushed to the report vs the one that the report was designed against.
 
As I am sure you know, since you are pushing the data, vs pulling the data back from the database it is harder to keep the fields in sync.  A verify database command may return OK, but it may be against old test data and not the latest schema (which is your live data)...so I guess that is where I would start, making sure that the schemas match.
 
HTH


Posted By: praveenhotha
Date Posted: 18 Jan 2012 at 3:53am
Thanks for the reply. :)
It was my mistake. I was mapping the subreport and the data tables incorrectly :(



Print Page | Close Window