Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subreports or another method

Status
Not open for further replies.

RPOC

IS-IT--Management
Jun 17, 2003
44
US
I am using crystal ver 9. I need to create a report that will generate several other reports. I figured that the best method would be to have the user enter 1 set of parameters and pass this information to the subreports. Based off those parameters some of the sub reports will run and others will not.

For example: The user will enter a set of parameters. There will be a parameter asking if report "A" should be run, then report "B", then "C". If A is responded to as Yes and B and C are no, I want "A" to be processed and the other 2 reports not to be processed.

Since I have never done this before I would like to know if this is a good solution to this. (I do not want to process the tables in report b and c in the above example. If they do get processed the report might run for a very long time)

An added constraint is all my processing has to be done in the report. I cannot modify the database or its tables.

Thanks
 
Do the subreports have parameters as well?

If the data is totally unrelated, then using subreports is a good idea. The main report would just be a container to get the list of reports to run from the user. You could place each subreport in its own section (I'd use 3 report headers), then enter a suppression formula for each to show/suppress based on the user's selection. By suppressing the section containing the subreport(s), the subreport(s) wouldn't execute.

Another option would be to set up the subreports as On-Demand subreports within the main container report, then let the user decide which subreport to run without prompting. Again, the subreports would not execute until clicked on.

-dave
 
Thanks for the info. The sub reports do have parameters as well. Across all of the reports will be a date parameter. Then each subreport will have a seperate set of parameters.



 
When Dave states if the data is totally unrelated, he means if you aren't linking by some common field, then create multiple report footer sections and place each subreport within each.

The you can right click each of these sections and select format section-> and select the X2 next to suppression and use a formula to suppress, such as:

{?MyParameter} <> "Financial section"

As for the parameters, don't create any parameters in the subreports, just link the parameters in the main report to the DATE FIELD in the subreports.

Since you're using a date parameter, you may need to then go in to each subreport and adjust the Report->Selection Formulas->Record

You'll see that it has something like:

{table.field} = {PM-MainReportStartDate}
and
{table.field} = {PM-MainReportEndDate}

Change it to something like:

{table.field} >= {PM-MainReportStartDate}
and
{table.field} <= {PM-MainReportEndDate}


-k

 
Thanks for the added details



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top