You are reading help file online using chmlib.com
|
Rave Reports Developer Guide Getting & Setting Parameters . |
Top Previous Next |
QUESTION How would I set / get parameters while using the Rave Language?
SOLUTION You must first define your parameter(s) in Rave to be able to set or get parameter(s) while in the Rave Event Editor. Using the parameter "MyParam" as an example, the following code would then set and then use the value from the specified parameter. Remember that parameters must always be a "string" value. This code was tested from the OnGetText event of a text component.
// To SET a parameter in Delphi (before running a report) RaveProject.SetParam('MyParam', 'My Param Value');
// To GET your parameter within an event Value := RaveProject.GetParam('MyParam');
// To SET your parameter within an event RaveProject.SetParam('MyParam', 'NewValueAsString');
// Sample event that "increments" a parameter named "LineCount" { Event for DataTextCount1.OnGetText } function DataTextCount1_OnGetText(Self: TRaveDataText; var Value: string); var iCount: Integer; sCount: String; begin iCount := StrToInt(RaveProject.GetParam('LineCount')); sCount := IntToStr(iCount + 1); Value := sCount; RaveProject.SetParam('LineCount', sCount); end OnGetText;
|
You are reading help file online using chmlib.com
|