Version Information: This sample is prepared with Crystal Reports 2008
Creating a chart in Subreport using full functionality of subreport:
This is a continuation to my previous blogs on Crystal Reports Charts
In this demo I will be using the same data as in my previous demo – but with a difference. This demo will be exploiting the full functionality that can be provided by a on- demand subreport. The main report will be based on a single table (Student) and the subreport will be based on the combination of tables Student, Course_master and student_course. This will illustrate that we can create the main report on master data, and when the user requires to view details regarding 1 particular record in the master data, he/she can click on the on-demand subreport link to fetch data from multiple detail tables pertaining to that master data and display the corresponding chart.
The below is the screenshot for main report. All the data columns for the main report come from the Student table.(The Master table in this example)
A subreport is inserted in the detail section of the main report. We use Insert – Subreport to get the below screen. Fill the name of the new subreport, check the option for On-demand subreport and then click on the Report Wizard.
In the report wizard, select the proper database connection, select all the detail tables required to create the chart and link them correctly in the link tab.
Link the main report to the subreport via the primary key(Student ID in this example). Also select how you want this parameter to afftect data selection for subreport.
Open the subreport for design. Insert the chart in the report header and suppress all other sections. Settings for chart Expert can be done similar to the previous blog.
If we look at the preview of the main report, it is a list with a link for details available for each record.
If we click on the link for a particular record, the chart for marks opens for that particular student.