crystal-reportssubreport

CR | Open subreport by clicking on database field in main report


this case is a little more difficult I think.

In my main report I have material numbers displayed in a cross table. From time to time I need to show more details for one of the material numbers. Therefore I want to double click this field and then copy the corresponding material number to the sub report (directly in the parameter field). Another fixed parameter field is the date, which has the max date "today" and the min date "today-365d".

Moreover I don´t want to make the sub-report visible in the normal report the whole time. It should just be visible if I double click a material number.

Is there any possible way to that?

Thanks in advance!


Solution

  • You can do this in 2 ways, with either an on-demand sub report or by utilising the drill down

    Using sub reports In your main report go to insert>Subreport. Create your sub report with the detail you wish to see, then click the tick box for "On-demand subreport". Place the sub report in the details section along with your material numbers. You'll see it appear like a hyperlink. Right click then Format Subreport>Subreport tab. You can change the Subreport caption to the material number from your data by clicking the formula button for "On-demand Subreport Caption" and entering your material number field name as the result of the formula. Whjen you ruin the report you can click the link to see the etail in the subreport

    Drill down method Create a report with all the detail you need in the details section. Group by material number then in section expert (Report menu) use the tick box to "Hide (Drill-Down OK)" the details section. Now when you preview the report the group header will show with the material number, clicking this group header will open the details section.