psFunctionName - cDRReport¶
Methods - Properties - Events
Type¶
String
Default¶
None
Arguments¶
| Argument | Description |
|---|---|
sReportID |
ID of the report. Can be ID of the main report or the ID of a sub-report. This argument can be passed as an empty string. The empty string can be written as C_USEMAINDRREPORTID. |
iIndex |
The N-th function in the report |
Description¶
Sets/Gets the name of the N-th function defined in the report. A report may contain user-defined and built-in functions. User-defined functions appear in the field explorer and have a name.
Use the method FunctionCount to find out how many functions there are.
Note that changing the function name may cause function execution errors when other functions make use of the original function name.
This property cannot be used before the report OCX object is initialized. The COM object creation is - when not done before - created as part of the OpenReport method.
DataFlex Framework usage¶
- Web
- Windows
- FlexTron
Sample¶
Object oReport is a cDRReport
Set psReportName to 'MyReport.dr'
End_Object
Object oRunReportButton is a Button
Set Label to 'Run Report'
Procedure OnClick
Integer iFunction iFunctions
String[] sFunctionNames
String sReportId sSubReportId
Get OpenReport of oReport to sReportId
Get SubReportId Of oReport sReportId 1 to sSubReportId
Get FunctionCount of oReport sSubReportId to iFunctions
Move (ResizeArray (sFunctionNames, iFunctions)) to sFunctionNames
Decrement iFunctions
For iFunction From 0 To iFunctions
Get psFunctionName of oReport sSubReportId iFunction to sFunctionNames[iFunction]
Loop
Send CloseReport sReportId
End_Procedure
End_Object
The above example opens a report, assumes the report contains a sub-report, and collects the function names of all user-defined functions in the report.