Skip to Content

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

(http://scn.sap.com/community/crystal-reports/blog/2012/04/30/using-charts-in-crystal-reports-part-1

http://scn.sap.com/community/crystal-reports/blog/2012/05/01/using-charts-in-crystal-reports-part-2

http://scn.sap.com/community/crystal-reports/blog/2012/05/02/using-charts-in-crystal-reports-part-3)

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)

/wp-content/uploads/2012/05/chart21_99874.jpg

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.

/wp-content/uploads/2012/05/chart19_99911.jpg

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.

/wp-content/uploads/2012/05/chart22_99912.jpg

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.

/wp-content/uploads/2012/05/chart23_99913.jpg

If we look at the preview of the main report, it is a list with a link for details available for each record.

/wp-content/uploads/2012/05/chart24_99917.jpg

If we click on the link for a particular record, the chart for marks opens for that particular student.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply