Report Header Template

C

cefrancke

Is there a way to create a report header template so that, it can be
used as a subreport in a main report's header section, and so that it
can size itself and adjust it's controls to fit the main report. This
adjustment is needed in case the main report is larger or smaller than
the header template.
I figure I can save space using company logos and repeating them for
every report. It also gives me the freedome to create different looking
reports (the detail section) while being able to insert or refer to the
header template. This way I can use the wizards to make my report, I
then make the adjustment to the detail and then when I'm finished, I
insert the header template as a subreport in the main reports header.

I've been playing around with adjusting the subreport (header template)
on the Open event of the subreport. But I cant seem to change the
viewable width of the subreport. In VB, when I break on the code to set
the subreport width, VB says it's changed but the view shows the size
set in the design view of the subreport.
NOTE: I'm not talking about the main report subreport control, I'm
making adjustments in the subreport's Open event and adjusting the
subreport values.

What I want to do is make all the size changes in the Open event of the
subreport, and adjust the subreport's size to fit the main report. With
a report header that is the same for all reports, it's not unusual for
some reports to be landscape, etc. So I want to adjust the size of the
subreport (header) to fit the main report.

TIA
 
L

Larry Linson

I'm not certain I understand what you want to expand/contract -- simply
changing the dimensions of the Subreport Control would not move nor resize
the Controls inside the Report embedded in the Subreport Control. I suspect,
unless you were wanting to use the same template for multiple clients with
only minor changes, that you would find it far simpler to create a report
with the header as you want it, then copy that report as the base on which
you create your reports. Adjust the header on each report as necessary. No
subreport, no worries about code to change the dimensions and spacing, etc.

You could even specify such a report as your "template" for all reports
(that's not quite the panacea it may seem, you'll discover) by either
changing the name in Tools | Options that identifies the report template or
name your report "Normal".

And, I am not sure anyone will be able to give you a workaround for the
resizing. And, if they did, you'd still have to work out how you were going
to expand/contract the contents of the embedded report.

Larry Linson
Microsoft Access MVP
 
C

cefrancke

Well I did put some resizing code in the header "template" report and
it's kind of working.
I can post it if you like...

I'm having issues with expanding the header report width during the
Open event of the header report.
When the main report begins to open the subreport (the header) fires
off the Open event of the contained header report.
In the header report Open event, the report looks for its parent, grabs
its parents size and resizes itself according to the
parent size. Then it adjusts the controls.

As I said before, VB says that the header report size has changed, but
in the preview of the parent report it has not.
Sorry for the confusion.
 
C

cefrancke

Dear Larry or anyone who may know,
After further research...

Is there a way to resize a subreport's width (not the subreport control
on the main report), before the main report is visible.
I tried to resize the subreport on it's Open event but it wont budge
when the main report is rendered.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top