Wednesday, October 19, 2016

Sub Reports in Crystal

Subreports allow you to combine unrelated reports into a single report. It is a report within a report. You can combine data that cannot be linked and present different views of the same data in a single report.
Difference between Subreport and main report −
  • It is used as an element in the main report and cannot be used as single report.
  • A Subreport cannot contain other subreports.
  • It can be placed in any report section and the entire subreport will print in that section.
  • It doesn’t have page header or page footers sections.

Unlinked Subreports

Unlinked subreports are standalone reports and their data is not linked to data in the main report. An unlinked subreport does not have to use the same data as the main report; it can use the same data source or a different data source entirely. Regardless of the underlying data sources, the reports are treated as unrelated.

Linked Subreports

Linked subreports use data that is coordinated with data in the main report. The program matches up the data in the subreport with data in the main report. If you create a main report with customer information and a subreport with order information and then link them, the program creates a subreport for each customer that includes all their orders.
Subreports can be linked with data-passing links or with subreport filters.
someways it acts as group by Information.(means all aggregated info you can show it in main report and all detailed information you can show it in subreport and link both with same column here the same column acts as a Parameter or filter to the main report 
Example:
Main Report you have Employee Master Information such as EmpName,EMp ID
and in subreport you have Employee Detail Information such as Salary,Age,Address,Emp ID
Here EmpID is same column so we will link Emp ID and this will acts as parameter and it will to Main Report.
Advantages:N need to combine data datasources in to single,you just need to find the same column in both the reports and link those reports with same column

Inserting Subreports

You can insert a new report or an existing report as subreport in a main report. The subreport has similar characteristics as the main report. The data source to be used in subreport must be similar to data source that is used in main report and it must also be located on the same BI repository. You can also choose a different source connection but it should have a field to link to main report.
A subreport can’t be inserted into another subreport. A subreport can be placed in any report section and the entire subreport will print in that section. However, a subreport cannot stand on its own. It is always inserted as an element into a main report.

No comments:

Post a Comment