Link to home
Start Free TrialLog in
Avatar of fpkeegan
fpkeegan

asked on

crystal reports 2011 Sub reports / loops

Crystal report 2011
CR Developer
Version 14.0.4.738 TRM

I have a report that has a main report with a page header defined. The main report is used to select the input parameters.  The main report calls 6 sub reports; each sub report is defined in its own separate report footer.  Three of the sub reports are cross tab reports.   The main report does not use the detail section.

The user selects a set of parameter for the report. These parameters are displayed as part of the page header.

The user now wants to be able to do a select of “ALL” on one of the input parameters.  The idea is to generate a concatenated report.  So the header and six sub reports would execute for the first item in the list, the next item and so on. The list can be controlled by a data base select, so the user only selects the ALL item.

I have done this before by converting the main report to a sub report and then calling the subreport  in  a group by detail section detailed section.  But in that case the main report did not have call to a sub report.

I know that subreports cannot call subreports (if it could it would simplify this problem).

Any idea on how to do this with such a complicated report?
Avatar of vasto
vasto
Flag of United States of America image

I don't think that this is possible because you have subreports. If you can place the subreports in the details section and use groups to handle the printing then obviously it is a matter of providing the list of the parameters.

Another option is to use a 3rd party tool. The process you are describing is known as "data driven" publication. You can provide a recordset and one or more reports will be executed against each record in the recordset. So instead of changing the report you can provide a query , which will retrieve all possible records and then run the report in the normal way for each of the values returned by the query. You can check R-Tag Report Manager (www.r-tag.com). The only think I am not sure it can do is to combine all generated files at the end, because they will be related to different records. But this might be possible too, you need to ask the tech support. They have a free viewer , which is able to handle this scenario. Double check if the license is free because I noticed some recent changes in licensing.
Avatar of fpkeegan
fpkeegan

ASKER

I work for a large Corporation , this limits the use of any other software products.  It would take more than a year to get a new product in here to just test.  This place is really locked down.  We do not even have admin rights on our own PCs. And USBs are outlawed.  

The soultion needs to be a crystal reports solution.
The other option is to get the list of all items in the main report, put your subreports in the details section, group by item id ( or whatever unique field you have). if your query returns just one record the report will work as now. If the query returns multiple records  you will see result similar to resulls from data driven reports. You can use Group Header / Footer to print the data which is printed on report header / footer in your current report.
Why not simply group the report on whatever that parameter controls.  This would allow you to place the subreports in Group Footers instead of Report Footers.  When the user selects a regular value in that parameter, only one Group would be selected.  

When the user selects ALL, the record selection would bring in all Group values and you would get the desired result.
The data cannot go in to the detailed section. The report has a report footer section  that is not a sub report . The footer is for a cross tab report. The cross tab report must be in the footer section because cross tabs that are in sub reports will not expand horizontally.


I will try the group footer.
Getting closer.
There is  one group header , that contains the page header. It has the "Change Group options" , with the "Repeat group header on each page" checked. The data in the group header changes on each loop.
The details section is hidden,
There are 6 separate group footers , each one contains a separate sub report or a crosstab report.
The data in each section prints correctly. The problem is that the  group Page header only prints on the first page of each loop. Not on each page that makes up the group footer..
ASKER CERTIFIED SOLUTION
Avatar of fpkeegan
fpkeegan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial