variable initialization rb 12
Hi:
We've found that the variables created for example in the event
"ReportOnInitializeParameters" completed the report are not initialized.
This is correct because the rb version 7 is initialized all variables at the
end of the report.?
Recargs
Edgar Britez
www.sebaot.com
We've found that the variables created for example in the event
"ReportOnInitializeParameters" completed the report are not initialized.
This is correct because the rb version 7 is initialized all variables at the
end of the report.?
Recargs
Edgar Britez
www.sebaot.com
This discussion has been closed.
Comments
RB 9 introduced the Report.OnInitializeParameters event, prior to that the
event did not exist.
The Report.OnInitializeParameters event is working as designed.
From the RBuilder help topic for TppReport.OnInitializeParameters....
---------------------------
This event fires whenever a report is generated via a call to the Print
method. This event occurs prior to the AutoSearch events. Use this event to
- Define Report.Parameters[] and Report.AutoSearchFields[]
- Set Parameter and AutoSearchField values.
- Display a custom dialog that enables a user to enter parameter values.
This is useful when not using the built-in AutoSearch feature.
- Generate custom SQL that adds autosearch criteria.
Set the Cancel parameter to True to cancel the report generation process.
-------------------------
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
try to explain....
I declared local variables for example en the event
Report.OnInitializeParameters in RAP.
I print the report
then.... back to print a second time same report
In second time the local variables are not initialized, are assigned the
value first impression.
Example:
In Report.OnInitializeParameters in RAP. declared
var v_where:string;
In first print asigned v_where := vwhere + 'where codigo = 1';
result 'where codigo = 1';
in second print v_where := vwhere + 'where codigo = 2';
result 'where codigo = 1where codigo = 2';
as if no re-define the variables in second time.
for now we are solving empty initializing all variables defined. Example:
v_where := '';
but it is assumed that each time you run an event the local variables should
be redefined.
In RB7 did so well, but not in rb12, this is ok or is it a rb12 bug?
Thanks
We tested multiple times with the same report and the
same data and the report never releases the report variables.
In the Event ReportInitialize on the report ,
you can test this simple code :
-------------------------------------
procedure ReportOnInitializeParameters(var aCancel: Boolean);
var Var1 : String;
begin
Var1 := Var1 + ' Hellow ';
ShowMessage(Var1);
end;
-------------------------------------
The variable Var1 never releases.
Thanks,
could reproduce the problem?
Regards
"Edgar Britez" escribi? en el mensaje
RAP code.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com