soozh
asked on
Crystal reports loop question
I have a report that has a sub report that does some processing. The parameter to the sub report is a year. I want to call the sub report for a range of years. This is provided by the user as a parameter.
So the user may enter a range of 2007 to 2010. So then i want to call the sub report for the years 2007, 2008, 2009, 2010. Another time a different range would be entered.
Is this possible? The main report does not have any "data" and no database connection of its own... i just would like to somehow use the parameter range to call the sub report for each value in the range.
Really its just a for loop... would be great if i could put the sub report in the details section and then execute it for the supplied range.
So the user may enter a range of 2007 to 2010. So then i want to call the sub report for the years 2007, 2008, 2009, 2010. Another time a different range would be entered.
Is this possible? The main report does not have any "data" and no database connection of its own... i just would like to somehow use the parameter range to call the sub report for each value in the range.
Really its just a for loop... would be great if i could put the sub report in the details section and then execute it for the supplied range.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Nothing really springs to mind, as far as executing the subreport for each year goes. You can't execute a subreport in a loop or anything like that.
However, maybe there are other ways to handle this.
The subreport could accept a range of years and run for all of those years. If it groups on the year, you can basically get a separate report for each year (each year starts on a new page, etc.).
For that matter, if the main report doesn't contain anything but this one subreport, do you really need the subreport at all? Maybe you could have the main report produce a report for the range of years, grouped on the year, and forget the subreport.
James
However, maybe there are other ways to handle this.
The subreport could accept a range of years and run for all of those years. If it groups on the year, you can basically get a separate report for each year (each year starts on a new page, etc.).
For that matter, if the main report doesn't contain anything but this one subreport, do you really need the subreport at all? Maybe you could have the main report produce a report for the range of years, grouped on the year, and forget the subreport.
James
ASKER
any other solutions?