IAdhocReport.SaveData

Fore Syntax

SaveData(Callback: ICubeCallback);

Fore.NET Syntax

None;

Parameters

Callback. An object that is used to handle errors occurring on saving data.

Description

The SaveData method saves data edited in the Table visualizer.

Comments

It is allowed to edit data in the Table visualizer if IAdhocReport.AllowEditData is set to True.

To get the attribute whether the data in the Table visualizer is changed, use the IAdhocReport.IsDataChanged property.

Fore Example

The example describes a procedure of saving data edited in the Table visualizer.

Executing the example requires a form with the DashboardDocumentViewerBox component. The component is used as a data source by the UiDashboard component with the UiDashboard1 identifier. The dashboard is loaded to UiDashboard1 that enables the user to edit data in the Table visualizer.

Add a link to the UI system assembly.

Sub SubSaveData;
Var
    Dashboard: IAdhocReport;
    Callback: ICubeCallback;
Begin
    // Get dashboard
    Dashboard := UiDashboard1.Instance As IAdhocReport;
    // Check if data is edited
    If Dashboard.IsDataChanged Then
        // If data is edited, save changes
        Callback := New CubeCallback.Create;
        Dashboard.SaveData(Callback);
    End If;
End Sub SubSaveData;

// Class to handle errors occurring on saving data
Class CubeCallback: Object, ICubeCallback
    
    Public Sub OnCallback(Argument: ICubeCallbackArgument);
    Begin
        WinApplication.InformationBox(Argument.Error.Message);
        Argument.IgnoreError := True;
    End Sub OnCallback;
    
    Public Function get_Argument: ICubeCallbackArgument;
    Begin
        Return Null;
    End Function get_Argument;

End Class CubeCallback;

After executing the example the data edited in the Table visualizer is saved. If an error occurs on saving, a message is displayed.

See also:

IAdhocReport