Refreshing Letterhead
I have a collection of 45 reports that I have created using ReportBuilder
which all have our company's letterhead at the top of the page. I have a
copy of the letterhead saved by itself in a .rtm file that I used to load
the reports from when they were originally created. This worked wonderfully
to initially create the reports.
However, the letterhead has changed. Now it seems that I have to go back
and manually update the 45 reports separately to implement the change. I
have tried programmatically calling the Report.Template.LoadFromFile
procedure but the Template only contains the page header band and none of
the detail bands required for the individual letters, so that only resulted
in blank letterhead being printed.
Is there a way to refresh the template? If not, how would I best
re-implement these letters so that a change to the letterhead will be
auto-magically inherited after being only fixed in one place?
Thanks for any input,
--
Michael Simons
Software Programmer
Steven J. Baum P.C.
msimons@mbaum.com
which all have our company's letterhead at the top of the page. I have a
copy of the letterhead saved by itself in a .rtm file that I used to load
the reports from when they were originally created. This worked wonderfully
to initially create the reports.
However, the letterhead has changed. Now it seems that I have to go back
and manually update the 45 reports separately to implement the change. I
have tried programmatically calling the Report.Template.LoadFromFile
procedure but the Template only contains the page header band and none of
the detail bands required for the individual letters, so that only resulted
in blank letterhead being printed.
Is there a way to refresh the template? If not, how would I best
re-implement these letters so that a change to the letterhead will be
auto-magically inherited after being only fixed in one place?
Thanks for any input,
--
Michael Simons
Software Programmer
Steven J. Baum P.C.
msimons@mbaum.com
This discussion has been closed.
Comments
template in to the subreport for the header content. This is demonstrated
in the RBuilder\Demos\EndUser\DynamicSubreportLoading project. You could
take this approach for your future reports. However, you should be able to
edit the template text (much like a dfm format for the object definitions)
that you currently have in order to delete the components in the header band
and drop a subreport definition in the template. To see what you need to
add, drop a subreport into a report and then look at the template after you
save the template down you should see the object definition of the subreport
in the header band. The Report.Template.Format should be set to ftAscii.
If you have binary templates, then you can edit them as ascii text by using
this converter project:
http://www.digital-metaphors.com/tips/ConvertBinaryTemplateToASCII.zip
Cheers,
Jim Bennett
Digital Metaphors Corp.
http://www.digital-metaphors.com
info@digital-metaphors.com
rebuild your 45 reports by hand. You can write a program to load the
reports and change the header bands in code. You can either change them
this one time for the new information, or you can spend more time and build
dynamic subreports loading into it. We need to figure out why the detail
band doesn't load from a template into the report. Can you load the
template correctly without trying to convert the header band?
Cheers,
Jim Bennett
Digital Metaphors Corp.
http://www.digital-metaphors.com
info@digital-metaphors.com
for future report solutions. To convert your 45 reports, you can
sequentially load the 45 templates into one report object. When the report
template is loaded into the report, you can check the
Report.HeaderBand.Objects[] array property (there is a Band.ObjectCount
property to get the count) to loop through the components in the band. Then
you can check for the components that you want to change. After the loop,
you can call Report.Template.SaveToFile and it will be saved to the template
as the new version.
Cheers,
Jim Bennett
Digital Metaphors Corp.
http://www.digital-metaphors.com
info@digital-metaphors.com
approach might work for you as you have described it. Since you have two
header band objects, you could loop through the target header band and free
all of the controls in it. Then loop through the source header band and
reassign the band property of them to the new report. By assigning the band
property of a control, you will effectively remove it from the source report
band and assign it to the target report band. For a TppComponent, the band
is the parent and the form is the owner.
Cheers,
Jim Bennett
Digital Metaphors Corp.
http://www.digital-metaphors.com
info@digital-metaphors.com