Problems in upgrade from 17.01 to 19.03
I'm testing upgrade from 17.01 to 19.03
noticed that report parameter cannot have same name as component in same form.
For example if I have some ppDbText which component name is Profit I can't add parameter to report with that same name ppReport1.parameters.add('Profit', dtDouble, fProfit);
I can change the code, but our customers have plenty of customized report templates which are looking parameter with old name.
Is there anyway to avoid huge conversion jobs?
noticed that report parameter cannot have same name as component in same form.
For example if I have some ppDbText which component name is Profit I can't add parameter to report with that same name ppReport1.parameters.add('Profit', dtDouble, fProfit);
I can change the code, but our customers have plenty of customized report templates which are looking parameter with old name.
Is there anyway to avoid huge conversion jobs?
Comments
The Report and all its child objects (Parameters, Bands, Groups, Labels, DBTexts, ...) are Owned by the Form/DataModule. Delphi requires the names be unique.
In older versions, there was a bug in which TppParameter had a nil Owner.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Thanks for reply. I realized that already by looking the source difference after posting the message.
So you have any practical tip for handling upgrade in customer side. I really don't like idea of our distributor to modify our 2000 customized invoices manually.
I think that I could write little program to scan all rtm's and if it detects problematic report template replace component name in.
I recommend writing a utility that can edit the template text. The format is the same as the Delphi .dfm.
Search for TppParameter objects and prefix the name with 'p'. For example
object Company: TppParameter
convert to
object pCompany: TppParameter
If storing the .rtm's as binary, convert to text. Here is an rbWiki 'How To' with details
http://rbwiki.digital-metaphors.com/end-user/fundamentals-end-user/how-to-edit-templates-as-text/
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
That exactly what I had in my mind. And it works perfectly.