Skip to main content
All docs
V26.1
  • TdxReport.Parameters Property

    Provides access to the collection of report parameters.

    Declaration

    property Parameters: TdxReportParameters read;

    Property Value

    Type Description
    TdxReportParameters

    A report parameter collection.

    Remarks

    The collection accessible through the Parameters property is populated and updated automatically from the current report template definition.

    Note

    The Parameters property provides access to a read-only report parameter collection. If the list of parameters changes within the report template definition, the collection is updated automatically the next time you access it in code.

    Available Options

    You can use the ParamByName property to access a stored parameter by name. In addition, you can use the Parameters.Items property to access all parameters stored in the collection.

    Refer to the TdxReportParameters class description for detailed information on all available options.

    Code Example: Disable a Parameter’s Editor

    The following code snippet disables the ShowPendingTransactions parameter for closed periods so users cannot change its value in the UI:

    uses
      dxReport,              // Declares the TdxReport class
      dxReport.Parameters,   // Declares the TdxReportParameter class
      System.SysUtils;       // Declares the CurrentYear function
    
    procedure TForm1.ShowTransactionsReport(ATransactionsYear: Integer);
    var
      AShowPendingTransactionsParameter : TdxReportParameter;
    begin
      // Set the reporting period
      dxReport1.Parameters['TransactionsYear'].Value := ATransactionsYear;
      // Find the `ShowPendingTransactions` report parameter
      AShowPendingTransactionsParameter := dxReport1.Parameters['ShowPendingTransactions'];
      if ATransactionsYear < CurrentYear then
      begin
        // Indicate that the period is closed
        AShowPendingTransactionsParameter.Value := False;
        // Prevent users from changing the parameter value in the UI
        AShowPendingTransactionsParameter.Enabled := False;
      end;
      // Open the report
      dxReport1.ShowViewer;
    end;
    
    See Also