Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


crystal reports 2011 Sub reports / loops

Posted on 2014-03-20
Medium Priority
Last Modified: 2014-11-27
Crystal report 2011
CR Developer
Version 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?
Question by:fpkeegan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 18

Expert Comment

ID: 39943618
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.

Author Comment

ID: 39943662
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.
LVL 18

Expert Comment

ID: 39943722
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.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 23

Expert Comment

by:Ido Millet
ID: 39943807
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.

Author Comment

ID: 39950702
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.

Author Comment

ID: 39957448
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..

Accepted Solution

fpkeegan earned 0 total points
ID: 39957548
The group footer header problem is a known problem. This is the work around.


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question