TdxBackendCustomParameters<T> Class
The base class for backend client parameter collections.
Declaration
TdxBackendCustomParameters<T: TdxBackendCustomParameter> = class abstract(TOwnedCollection)
Remarks
TdxBackendCustomParameters is a generic class that implements collection functionality for parameters used by TdxDashboard/TdxDashboardControl and TdxReport/TdxReportControl components.
Terminal descendants instantiate TdxBackendCustomParameter with corresponding parameter classes.
Main API Members
The list below outlines key members of the TdxBackendCustomParameters class:
- BeginUpdate | EndUpdate
- Allow you to avoid excessive notifications and improve performance during batch changes.
- Count
- Returns the number of parameters stored in the collection.
- FindParam
- Returns the stored parameter with the specified name or returns
nil/nullptrif the collection does not contain the target parameter. Use this method to safely search for a parameter that may not exist. - Items
- Returns the stored parameter by its index in the collection.
- ParamByName
- Returns the stored parameter with the specified name or raises an exception if the collection does not contain the target parameter.
Note
You can omit
ParamByNameand use only the parameter name in square brackets (for example,dxControl1.Parameters['ParameterName']instead ofdxControl1.Parameters.ParamByName['ParameterName']).
Terminal TdxBackendCustomParameters Class Descendants
Do not use the TdxBackendCustomParameters class directly. Use the following descendants instead:
- TdxDashboardParameters
- A collection of dashboard parameters.
- TdxReportParameters
- A collection of report parameters.
Code Examples
The following code snippets display all parameter labels or a unique identifier where a label is missing. They perform the same operation, but use component-specific APIs to access properties.
List Report Parameter Labels
uses
dxReport.Control, // Declares the TdxReportControl class
dxReport.Parameters, // Declares the TdxReportParameter class
dxMessageDialog, // Declares the TdxMessageDialogForm class
System.StrUtils; // Provides advanced string management routines
procedure TForm1.cxButton1Click(Sender: TObject);
var
AList: TStringList;
AParameter: TdxReportParameter;
begin
// Create a TStringList instance
AList := TStringList.Create;
try
// Iterate through report parameters
for AParameter in dxReportControl1.Parameters do
AList.Add(Format('- %s', [
// Use the parameter Name if Description is missing
IfThen(AParameter.Description <> '', AParameter.Description, AParameter.Name)
]));
// Display the parameter list or a notification message if the list is empty
if AList.Count > 0 then
dxShowMessage(AList.Text)
else
dxShowMessage('The report has no parameters.');
finally
AList.Free;
end;
end;
List Dashboard Parameter Labels
uses
dxDashboard.Control, // Declares the TdxDashboardControl class
dxDashboard.Parameters, // Declares the TdxDashboardParameter class
dxMessageDialog, // Declares the TdxMessageDialogForm class
System.StrUtils; // Provides advanced string management routines
procedure TForm1.cxButton1Click(Sender: TObject);
var
AList: TStringList;
AParameter: TdxDashboardParameter;
begin
// Create a TStringList instance
AList := TStringList.Create;
try
// Iterate through dashboard parameters
for AParameter in dxDashboardControl1.Parameters do
AList.Add(Format('- %s', [
// Use the parameter Name if Description is missing
IfThen(AParameter.Description <> '', AParameter.Description, AParameter.Name)
]));
// Display the parameter list or a notification message if the list is empty
if AList.Count > 0 then
dxShowMessage(AList.Text)
else
dxShowMessage('The dashboard has no parameters.');
finally
AList.Free;
end;
end;