Skip to main content
All docs
V26.1
  • TdxBackendCustomParameter Class

    The base class for parameters used in TdxDashboard/TdxDashboardControl and TdxReport/TdxReportControl components.

    Declaration

    TdxBackendCustomParameter = class abstract(TCollectionItem)

    Remarks

    Parameters allow you to apply dynamic filters to source data for TdxDashboard/TdxDashboardControl and TdxReport/TdxReportControl components.

    Main API Members

    The list below outlines key members of the TdxBackendCustomParameter class. These members allow you to configure data field parameters in backend client components.

    AllowNull
    Specifies whether Null can be assigned as the parameter value.
    DataType
    Returns the parameter data type.
    Description
    Returns the parameter label displayed in the UI.
    Enabled
    Specifies if users can change the parameter value in the UI.
    IsMultiValueParameter
    Indicates if the parameter has multiple values.
    IsRangeParameter
    Indicates whether the parameter defines a date/time range.
    Name
    Returns the unique parameter identifier.
    Value | Values
    Specify the default parameter value.
    Visible
    Specifies whether the parameter editor is visible in the UI.

    Indirect TdxBackendCustomParameter References

    The following public API members reference the TdxBackendCustomParameter class as terminal descendant instances:

    TdxBackendCustomParameters.FindParam
    Returns the stored parameter with the specified name or returns nil / nullptr if the collection does not contain the target parameter. Use this method to safely search for a parameter that may not exist.
    TdxBackendCustomParameters.Items
    Returns the stored parameter by its index in the collection.
    TdxBackendCustomParameters.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 ParamByName and use only the parameter name in square brackets (for example, dxControl1.Parameters['ParameterName'] instead of dxControl1.Parameters.ParamByName['ParameterName']).

    Terminal TdxBackendCustomParameter Class Descendants

    Do not use the TdxBackendCustomParameter class directly. Use the following descendants instead:

    TdxDashboardParameter
    A dashboard parameter.
    TdxReportParameter
    A report parameter.

    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;
    

    Inheritance

    TObject
    TPersistent
    TCollectionItem
    TdxBackendCustomParameter
    See Also