Skip to main content
All docs
V26.1
  • TdxDashboard.State Property

    Provides access to the dashboard state (in the JSON format).

    Declaration

    property State: TStringList read;

    Property Value

    Type Description
    TStringList

    Stores a dashboard state (as strings in the JSON format).

    Remarks

    The State property allows you to load and apply previously saved user interaction states (filter criteria, drill-down values, dashboard parameter values, etc.) to the current dashboard.

    State and Parameters

    The State property value stores parameter values. Every parameter value or setting change updates the State property value. Enclose multiple parameter changes between Parameters.BeginUpdate and Parameters.EndUpdate procedure calls to avoid excessive state updates and improve performance.

    Available Options

    Call State.LoadFromFile/State.LoadFromStream and State.SaveToFile/State.SaveToStream procedures to import and export dashboard states in the JSON format.

    In addition, you can use State.Strings and State.Text properties to access and modify dashboard states directly (if required).

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

    Code Example: Save Dashboard State to File in Response to User Changes

    The following code example saves the current dashboard user interaction state to a JSON file on every change:

    uses
      dxDashboard;  // Declares the TdxDashboard class
    // ...
    
    procedure TMyForm.dxDashboard1StateChanged(ASender: TdxDashboard);
    begin
      ASender.State.SaveToFile(ASender.Name + 'State.json');
    end;
    
    See Also