Version Information: This sample is prepared with Crystal Reports 2008
Creating a chart using 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)
I will continue with the same sample data. In the previous example I had created a single chart showing the total marks obtained by all the students and also a chart showing marks obtained in different subjects by a single student.
In this blog I will demonstrate how to use a subreport to display a chart.
I will create a new subreport by clicking on Insert -Subreport-Create a subreport with the Report Wizard. I have selected the option for On-demand subreport.
When I click on the Report Wizard , I can choose the datasource for the report. As the datasource for the parent and child report is identical in this case, I choose the same database and tables. When I click on “Next” button, I can link the tables. This is also done identical to the main report. Then I click on “Finish” and “OK” and insert the subreport in a new Group Footer section of main report.
Next I create a parameter in the subreport . This will be necessary to link the student in the group of the main report to the data in the subreport.
Next I come back to the main report. I right click on the subreport and choose “Change Subreport links”.
I link the parameter created in subreport to the student details in main report. This link should be based on the primary key(s) . In my demo data the student name is unique, so I have used the same to link the main report to the subreport.
I create the chart in the report header of the subreport. The student name , for whom the report is created, in displayed in a separate report header. All other sections are suppressed.The method of creation of the chart is similar to my previous blog.
When I look at the preview of my main report, a hyperlink appears below each the marks of each student.
When I click on the hyperlink, the chart opens for the corresponding student.
Note:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |