Subreport/Work Sheet

Acropolis

Registered User.
Local time
Today, 19:59
Joined
Feb 18, 2013
Messages
182
I have a system that generates worksheets for the engineers.


There are several different job types and work sheet layouts.


Up until now, I have generated separate files for each type of job, but I want to put them all into one file.


I thought I would create a report with:


Page Header - Showing common information between all worksheets
Detail - Sub report
Page Footer - Showing common information between all worksheets


I would then create individual reports, that would we feature in the sub report and be different for each page depending on the job type that is on that page. I was planning on setting the sub report source with an on load event.


I have done this, but it sets them all to the same, rather than been different for each page. Is there anyway to do what I am trying to achieve or do I need to find a different way altogether?


thanks
 
struggling to understand what you are saying but it sounds like you need to modify the subreport controlsource on the onformat event, taking account of the page number in some way.

Another thought is to have more than one subreport, separated by a pagebreak control and each report dedicated to a different report layout
 
Each page of the report needs to have the following;


Same page header
Same page footer


Detail section - needs to showing a different sub report depending on the job type based on the information in the page header.


All jobs are in tblFieldWorks and have a FieldWorksJobTypeID associated to them, which links to tblFieldJobTypes. In that job types table, is a field called "Default Report" where I have the name of the sub report which needs to appear in the detail section of the report.


So for example;


Service call Job Type

Page Header - Standard
Detail - Sub report = rptSub_SC
Page Footer - Standard


Install Job type
Page Header - Standard
Detail - Sub report = rptSub_install
Page Footer - Standard


and so on


the header and footer details are the same for each, as this contains the site address, job details etc, but the details section needs to contain job specific information.


hope that helps make it a little clearer.
 
No matter which way I tried this it wouldn't work, it would always put the detail section as the last sub report that the code set the control source to, or it wouldn't load when I opened it in print preview, something about not been able to change the layout once printing had started.

Have now found a solution, by adding in design mode, multiple sub reports, all in the same place on top of each other, and making them all invisible. Then with the on format event, making the appropriate sub report visible for the job type to be displayed on that page. Works nicely and gives the exact result I wanted, and very easy to add different work sheets/job types in the future.

Only issue us getting everything to line up nicely, little tricky but getting there with it.

Thanks for the help, got me looking in the right direction.
 

Users who are viewing this thread

Back
Top Bottom