cancel
Showing results for 
Search instead for 
Did you mean: 

Situations in which we use reports

Former Member
0 Kudos

Hi All,

I am new to crystal reports i need to know in what cases do we need a sub reports ,Can some one explain me in detail?

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

JWiseman
Active Contributor
0 Kudos

hi Venkatesh,

there are many different usages for subreports:

1) if your main report runs off of database A and you want to bring in data from database B then a subeport may be your best method...combining data from different databases or data sources can be slow when you're linking them directly in a main report...so having a linked subreport may give you the best performance

2) if you need a subquery of your data...your main report may run off one set of data from database A, as an example sales, and you need to have cost data brought into your report...since linking a sales fact table to a cost fact table would cause a lot of duplicate records, then using a subreport would be a better idea.

3) you may have two different styles of formatting on the same data...you've got data coming in from database A and you need to have it formatted one way for odd pages and another way for even pages...subreports are good for that.

4) you may wish to apply further filters to objects...i.e. you may have a chart and a cross tab in a group and you want to further filter the values in those objects...using a subreport as a container for those objects and applying a further filter is a good usage.

5) you may wish to combine several reports. in this case you have a report inserted as a subreport into report header A, then another report inserted as a subreport in report header B, and then the third report is your subreport.

6) you can use a subreport to do complex calculations and share those values with the main report. or do complex calculations and then pass those as a link to your subreport to use there.

7) you may have a need for your end user to drill into another report from the main report...on demand subreports are useful in this case.

etc.

there are of course methods to bring in subqueries into a main report in a command object, or via sql expressions or linked data servers. but sometimes you want to keep the main query and any subqueries completely separate. in those cases use a subreport. if you just have a couple of values that you need to bring in to your main query, consider a command object with subqueries.

i hope this helps,

jamie

Answers (0)