TdxBackendDataSetCollection Class
A collection of backend dataset items.
Declaration
TdxBackendDataSetCollection = class(
TcxComponentCollection
)
Remarks
A backend dataset collection manages datasets (TDataSet descendants) for a TdxBackendDataSetJSONConnection component.
Main API Members
The list below outlines key members of the TdxBackendDataSetCollection class. These members allow you to manage datasets as data sources for backend client components.
Collection Management APIs
- Add
- Creates a new backend dataset item and adds it to the collection.
- Clear
- Clears the collection.
- Count
- Returns the number of collection items accessible through the Items property.
- Delete
- Deletes individual stored dataset collection items.
- Items
Provides indexed access to stored dataset collection items.
Tip
Cast the returned object to the TdxBackendDataSetCollectionItem class to access all public API members.
General-Purpose API Members
- Assign
- Copies datasets between collections.
- BeginUpdate | EndUpdate
- Allow you to avoid redundant notifications during batch collection changes.
Code Example: Load and Populate Report Templates from Datasets
This code example loads an XML-based report template (REPX) from a dataset, configures export settings, populates the template with data from another dataset, and displays the report preview:
uses
dxReport, // Declares the TdxReport component and related types
dxBackend.ConnectionString.JSON.DataSet; // Declares the TdxBackendDataSetJSONConnection component
// ...
procedure TMyForm.Button1Click(Sender: TObject);
var
ADataConnection: TdxBackendDataSetJSONConnection;
AReport: TdxReport;
ALayoutStream: TStream;
begin
ADataConnection := TdxBackendDataSetJSONConnection.Create(Self);
try
ADataConnection.Name := 'DataSetJSONData';
ADataConnection.DataSets.Add('Data', FDataSet);
AReport := TdxReport.Create(Self);
try
AReport.ReportName := 'Report';
ALayoutStream := FLayoutDataSet.CreateBlobStream(FLayoutDataSet.FieldByName('Layout'), bmRead);
try
AReport.Layout.LoadFromStream(ALayoutStream);
finally
ALayoutStream.Free;
end;
AReport.Language := 'fr-FR';
AReport.ExportFormats := [TdxReportExportFormat.PDF,
TdxReportExportFormat.RTF, TdxReportExportFormat.HTML];
AReport.FilterString := 'id = 5';
AReport.ShowViewer;
finally
AReport.Free;
end;
finally
ADataConnection.Free;
end;
end;
Direct TdxBackendDataSetCollection Class Reference
The TdxBackendDataSetJSONConnection.DataSets property references a TdxBackendDataSetCollection object.