I have a report that includes a sub report. I need to add a same sub report with minor modification for the report. Is there a way to copy one existing report within the main report, paste it, then go into that new sub report and only have to make the changes required for the slight differences between the sub reports. Please let me know.
To share values between a subreport and the main report in Crystal Reports, use shared variables. Using shared variables requires at least two formulas: One to store the value in a shared variable. Tthe other to retrieve the value from the shared variable.
In the Navigation Pane, right-click the report to which you want to add a subreport, and then click Design View. In the menu that appears, ensure that Use Control Wizards is selected. Open the Controls Gallery again, and then click Subform/Subreport. On the report, click where you want to place the subreport.
save subreport as
and save a local copy.insert sub report
and Existing report.
You will need two reports 1) Main Report 2) Subreport
1) Create a new standalone report that will be your Sub report
2) On you Main report, Click Insert Subreport -> Select Choose Existing Report -> Browse to the newly created subreport -> OK.
3) You will have a subreport that want. Now add links between sub report and Main report using Subreport links
4) This way you can add the same report multiple times and then in each subreport, you can do the individual changes you wish to do on each subreport, without having to change the whole report everytime.
Hope it helps.
The slight problem with @Siva answer is if you go into a Subreport and then go File -> Save As, Crystal still prompts to save the Main report which is now incl the Subreport and not the Subreport by itself. Hence in Step 3 Siva's answer the whole Main report would get added, instead of just the subreport.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With