Crystal Reports: 3 New Uses For Sub Reports
page 3 of 5
by Jason Dove
Average Rating: 
Views (Total / Last 10 Days): 21397/ 27

Reconciling Conflicting Groups

Often there is a requirement to show the same information summarised by logically conflicting groups.  For example: showing the total sales for each week within a month and totals sales per team in a month.

A typical sub report can be used to load the data again then group it by the second value, and this is the typical way to use a sub report.  But accessing the database again for data you have is a waste of resources which can be crippling with bigger reports.

The most efficient way to handle this is to load the information you want into one or more arrays and pass them through to the sub report to format and group as you want.

It is possible to display the array in the main report and forgo the need for a sub report at all, but if you are reporting against a lot of data there is a chance the report will finish before the array has been fully displayed.

View Entire Article

User Comments

Title: RE: But Crystal could do this better   
Name: Ray S.
Date: 2010-11-23 11:39:27 AM
To: Bill Geake

I'm sure others will weigh on the capability of passing
parms from Main report to subreports based on SQL commands.
Here's what I do:

1) In the subreport, when you are setting up the command
in the "Modify Command" window, create a parameter,
that has the same type as the calling parameter in the
Main report.

2) From the Main report, right click on the subreport
and select "Change subreport links...". Then link
the Main report's parameter to the subreport's

Is this what you had intended to do? If not, sorry for
confusing the issue.

Title: My Thoughts   
Name: PA
Date: 2010-11-23 5:37:51 AM
Hi All,

With due regards and respect to the ideas that have been discussed, I failed to understand the "hatred" factor and the "3 New Uses For Sub Reports" concept.

1. Report Header:
This is generally achieved with report templates

2. Reconciling Conflicting Groups:
A single report cannot contain grouping based on multiple logics and combinations , so this is the obvious use of a sub report. I failed to understand, what's new?

3.Conditional Data Targets:
As an alternative, this could be achieved by providing hyperlinks to individual reports by enabling the hyperlink(s) based on condition(s)

Your comments are appreciated.

Title: But Crystal could do this better   
Name: Bill Geake
Date: 2010-11-23 4:38:36 AM
If only there could be a way of making it easy to pass values from the main report through to the sub report SQL. Jason hates sub reports; I hate selection formulae, and these hatreds are connected. The performance hit on sub reports isn't just the extra query per sub report instance - it's also the failure to filter data on the server and the increased network traffic that results.

Perhaps it's just my ignorance, but I've never been able to pass parameters to Oracle SQL in sub reports. If SAP could sort this out with an intuitive GUI it would make rich reports so much easier.
Title: Mr   
Name: David WHite
Date: 2010-11-23 3:55:37 AM
Amazing! They say the best ideas are really simple. I would never have thought of holding common components in a subreport. What a brilliant idea!
Title: Mrs.   
Name: Preetha Raju
Date: 2010-11-22 9:25:33 PM
Really, very useful tips. Specially header concept with the sub report, which I never thought.

Thank you very much, looking forward for more tips from you.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-07-13 12:11:03 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search