Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

updating field aliases in RAP

edited September 2008 in End User
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

Comments

This discussion has been closed.