I have a main report. It´s working fine. My problem is in the sub report. In my sub-report I have a procedure with startdate and enddate. I would like to know if it is possible I can use the same date range from main report in my sub-report. I got a solution, but my solution needs to input the date range in main report and the same date range in my sub-report
-
I think you will need to set parameters values for sub report in code. – aMazing Dec 22 '15 at 01:59
-
Possible duplicate of [How can we pass a parameter from main report to subreport in crystal reports XI](http://stackoverflow.com/questions/2099131/how-can-we-pass-a-parameter-from-main-report-to-subreport-in-crystal-reports-xi) – Aaroninus Dec 22 '15 at 16:30
-
via Crystal Report Designer or via for example c# code? – Ferid Š. Sejdović Dec 28 '15 at 15:08
3 Answers
Right-click on the sub-report object and choose Change Sub-report Links, then select how the parameter is to be used by the sub-report.
you can watch this YouTube video explains how to change sub-report Links
you can read this post too about the same subject

- 840
- 10
- 24
you need to create the same parameters in sub report that you have created in main report and link those parameters using sub report links, Which you can get my right click the sub report in main report.
once you link both paramterts same input will be passed to sub report aswell.

- 9,043
- 12
- 40
- 63
To pass that date range to the subreport do a right click on it and Change Subreport Link. On Subreport Links window search for your parameters in the left side and move them to the right one, make sure once you have them on the right one the option for Select data in subreport based on field: is unchecked for those 2 parameters. Then click OK and open the subreport. Once inside the subreport, go to Report/Selection Formulas/Record... to open the record selection formula. Under your Report Fields you will see the 2 parameters and you will be able to pass them to the date field you have in your subreport.

- 659
- 7
- 20