TdxBackendCustomParameters<T>.FindParam(string) Method
Declaration
function FindParam(const AName: string): T;
Parameters
| Name | Type | Description |
|---|---|---|
| AName | string | The name of the target parameter stored within the collection. |
Returns
| Type | Description |
|---|---|
| T | The parameter with the name matching the The function returns |
Remarks
Call the FindParam function to safely access a stored parameter with the specified name.
Code Examples
Note
The FindParam method is common to report and dashboard parameters. These examples perform the same operation but use component-specific APIs.
Find Report Parameter by Name
uses
dxReport.Control, // Declares the TdxReportControl class
dxReport.Parameters, // Declares the TdxReportParameter class
dxMessageDialog; // Declares the TdxMessageDialogForm class
procedure TForm1.cxButton1Click(Sender: TObject);
var
AParameter: TdxReportParameter;
begin
// Find a parameter with the specified name
AParameter := dxReportControl1.Parameters.FindParam('countryParameter');
if AParameter <> nil then
// Display the parameter label
dxShowMessage(AParameter.Description)
else
dxShowMessage('Parameter not found.');
end;
Find Dashboard Parameter by Name
uses
dxDashboard.Control, // Declares the TdxDashboardControl class
dxDashboard.Parameters, // Declares the TdxDashboardParameter class
dxMessageDialog; // Declares the TdxMessageDialogForm class
procedure TForm1.cxButton1Click(Sender: TObject);
var
AParameter: TdxDashboardParameter;
begin
// Find a parameter with the specified name
AParameter := dxDashboardControl1.Parameters.FindParam('countryParameter');
if AParameter <> nil then
// Display the parameter label
dxShowMessage(AParameter.Description)
else
dxShowMessage('Parameter not found.');
end;
See Also