1
votes

I have a main reports which I used for accounting purposes and I built an sub report and attach to it. I want to update the sub report using a query so every time I open the main report the sub report will be updated based on the query I will used. But I don't know how to add new command.

I'm using Visual Studio 2010, SQL Server 2008 and Crystal Reports for Visual Studio.

2
confirm..opening the report can be understood as running the report?Siva

2 Answers

0
votes

If I understood your question....

What you should do is, create query/stored procedure which accept a parameter from the main report so every time sub report will display data based on main report.

Once you insert the sub-report to the main,

Right click on sub-report select Change sub-report links and tick the "Select data in subreport based on field" then you can select which parameter/field from Main report need to be linked with your sub-report parameter

Hope this helps

0
votes

Well, this is an old post and probably you have already figured it out....And I am not sure what you mean by "..a query that will be based on the selected date of users" but maybe someone will find it helpfull..

Right click on subreport>Edit Subreport> Database> Database Expert> under My connections or under thr DB that you're using> Add Comand. You can add your own sql command and all..