Link to home
Start Free TrialLog in
Avatar of dcprog
dcprog

asked on

Merge multiple reports into a single report with VB 6.0 DataReport

I have a form that lists several different names of reports a user can choose. Beside each report name is a checkbox. At the bottom is a print report button.

For example:

[x] Year Stats report for A Summary
[ ]  Year Stats report for B Summary
[x] Year Stats report for A
[ ]  Year Stats report for B
[x] Monthly Stats report for A
[x] Monthly Stats report for B
...
                                     [Print Report]


What I want is the ability for the user to select as many reports as he wishes by clicking on the checkboxes beside the report name and when he has finished making his selection he would click on the print button and all checked reports would be printed off as one. I know I can print each report individually within the code. This won't work for me.

The tough part is that I want to merge all selected reports into one report for two reasons:
1) I want the page numbering to be as if it were only one report. Therefore page 1 to n for the overall report.
     a) I do not want to print the first report page 1 to i and then print the second report page 1 to j and so on...
2) I want to be able to print this to a single file(html or pdf).

Is there a solution that allows a report to have subreports so that I can easily implement the solution I am looking for?

I am using Visual Basic 6.0 with the DataReport and the DataEnvironment designers

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of anv
anv

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
Avatar of dcprog
dcprog

ASKER

If it isn't possible to incorporate subreports, would it be possible to create one single report containing all the listed reports with one huge query, however each subreport would simply be a detail section and then I could set each detail section as visible or not depending on the selection? Is it possible to set a detail section as visible or not and for that matter can I have multiple detail sections in one report? Also what would I then do for the subreports that contain grouped sections?

It's not that I don't want to try crystal reports its just that I've never used it before and don't know how to program with it not to mention incorporating this 3rd party tool into my application and finally what the cost is to use crystal reports? I guess if it simply isn't possible to do this with the datareport designer then I will be left with no choice but to learn crystal reports. However I just want to be absolutely sure there is no other way to do what I want with the datareport designer.

Thanks.
>>could set each detail section as visible or not depending on the selection

yes u can using foloowing code syntax

Me.Sections(3).Visible = False  'Where Section Collection Starts with base 1...3 here is the detailed section..

as far as i know u can have only one detailed wection in Data Reports..

but in Crystal Reports yes u can have as many Details sections u want..

u can try the Evaluation of Crystal Reports available on the internet..
check this link ... if u want to use crystal reports..

https://www.experts-exchange.com/questions/20405257/SubReports-at-runtime.html