updating field aliases in RAP
Hello all, I have a report hooked to a JIT pipeline named 'Index_Fields' for
which fields are created on the fly based on field definitions defined by
the user. I need to know how to update their RAP calculations when they
change their field definitions.
Let's say, for instance, that they have defined the following field:
Name='MYFIELD1';Alias='My Field 1'
...and they have added two components to a report:
1. DBText1 and set the Field in the report editor to 'My Field 1', which
sets the DataField property to 'MYFIELD1'
2. Variable1 and added the following to the OnCalc event:
procedure Variable1OnCalc(var Value: Variant);
begin
Value := Index_Fields['My Field 1'];
end;
...and later changed the field definition to:
Name='MYOWNFIELD1';Alias='My Own Field 1'
--------------------------------------------------------------------------------
I am storing the report template in a db in ftASCII format. I know how to
update the DataField property of the DBText1 from 'MYFIELD1' to
'MYOWNFIELD1'. What I don't know how to do is update the code in the
Variable1.OnCalc event to
procedure Variable1OnCalc(var Value: Variant);
begin
Value := Index_Fields['My Own Field 1'];
end;
Thanks All,
Branden Johnson
which fields are created on the fly based on field definitions defined by
the user. I need to know how to update their RAP calculations when they
change their field definitions.
Let's say, for instance, that they have defined the following field:
Name='MYFIELD1';Alias='My Field 1'
...and they have added two components to a report:
1. DBText1 and set the Field in the report editor to 'My Field 1', which
sets the DataField property to 'MYFIELD1'
2. Variable1 and added the following to the OnCalc event:
procedure Variable1OnCalc(var Value: Variant);
begin
Value := Index_Fields['My Field 1'];
end;
...and later changed the field definition to:
Name='MYOWNFIELD1';Alias='My Own Field 1'
--------------------------------------------------------------------------------
I am storing the report template in a db in ftASCII format. I know how to
update the DataField property of the DBText1 from 'MYFIELD1' to
'MYOWNFIELD1'. What I don't know how to do is update the code in the
Variable1.OnCalc event to
procedure Variable1OnCalc(var Value: Variant);
begin
Value := Index_Fields['My Own Field 1'];
end;
Thanks All,
Branden Johnson
This discussion has been closed.
Comments
Take a look at the following rbWiki article on editing RAP from Delphi.
http://www.digital-metaphors.com/rbWiki/RAP/Fundamentals/How_To...Modify_RAP_Programs_in_Code
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
this right:
I need to know how to get the report template text (as if I had opened an
RTM file saved in ASCII format) so that I can change the DataField property
of data-aware controls like DBText.
Thank you,
Branden Johnson
between ppReport1.Template.LoadFromDatabase and the ShowModal call to the
Report Designer. And I need to update the /template/layout of the report
that has been loaded from the DB.
Take a look at another article.
http://www.digital-metaphors.com/rbWiki/End-User/Fundamentals/How_To...Edit_Templates_as_Text
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com