designer changing template variable names
I'm using ReportBuilder Enterprise 10.07 with Delphi 2007 for win32.
I created a report with a few Line objects in the Footer, to use as
signature lines. I left the default names alone, they happened to be
Line7 and Line8.
I then added into the Calc tab, in Procedure FooterBeforePrint:
Line8.Visible := (Report.PageNo = Report.PageCount);
That hides that line unless its the last page.
It worked just fine, so I saved the template as Report.RTM, binary format.
My co-worker also has ReportBuilder+Delphi, all the same versions as me.
He created an new project, dropped on a TppReport, and then loaded my
RTM template in his ReportBuilder designer.
He gets "cannot compile, error on FooterBeforePrint".
We look at the report, and he has no Line7 and Line8, they are there but
instead named Line9 and Line10!
So the Line8.Visible code fails, and he has to change it to Line10.Visible.
It appears that if I specifically use custom names for my objects like
DBText_Employee the object names stay the same between us. But if I drop
an object into the report, and leave it the default name (DBText1,
Line1, Shape1), they sometimes appear numbered differently in his designer.
It's as if the designer renames/renumbers objects when it loads from a
RTM template.
Is this normal? And if so, is there a setting that could avoid this
renaming?
Thank you.
Brad Phipps
I created a report with a few Line objects in the Footer, to use as
signature lines. I left the default names alone, they happened to be
Line7 and Line8.
I then added into the Calc tab, in Procedure FooterBeforePrint:
Line8.Visible := (Report.PageNo = Report.PageCount);
That hides that line unless its the last page.
It worked just fine, so I saved the template as Report.RTM, binary format.
My co-worker also has ReportBuilder+Delphi, all the same versions as me.
He created an new project, dropped on a TppReport, and then loaded my
RTM template in his ReportBuilder designer.
He gets "cannot compile, error on FooterBeforePrint".
We look at the report, and he has no Line7 and Line8, they are there but
instead named Line9 and Line10!
So the Line8.Visible code fails, and he has to change it to Line10.Visible.
It appears that if I specifically use custom names for my objects like
DBText_Employee the object names stay the same between us. But if I drop
an object into the report, and leave it the default name (DBText1,
Line1, Shape1), they sometimes appear numbered differently in his designer.
It's as if the designer renames/renumbers objects when it loads from a
RTM template.
Is this normal? And if so, is there a setting that could avoid this
renaming?
Thank you.
Brad Phipps
This discussion has been closed.
Comments
Perhaps there are multiple TppReport objects on the same form/datamodule.
Delphi requires names to be unique for all components owned by the
form/datamodule. For example if you place two reports on an empty form and
then load the same .rtm file, the second one will have it's elements renamed
by Delphi.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com