@@ -82,7 +82,11 @@ This example project uses a SQLite sample database ([nwind.db]) as the report's
8282To load a layout definition to the [ TdxReport] component, you must specify
8383report name ([ TdxReport.ReportName] ) and layout ([ TdxReport.Layout] ):
8484
85- ``` pas
85+ <!-- start-code-block -->
86+ #### Delphi
87+
88+ ``` delphi
89+
8690procedure TMainForm.LoadReportNameAndLayout();
8791begin
8892 // Ensure that the dataset has at least one record or a new record is being created:
96100 dxReport1.Layout.Assign(DataModule1.mdLayoutsLayout);
97101end;
98102```
103+ <!-- end-code-block -->
99104
100105To load a different report, assign a new report name and layout.
101106The assigned report replaces the current layout definition.
@@ -106,7 +111,11 @@ The assigned report replaces the current layout definition.
106111Once you assigned a name and layout to the [ TdxReport] component,
107112you can display [ Report Designer] [ dx-report-designer ] and [ Report Viewer] [ dx-report-viewer ] dialogs:
108113
109- ``` pas
114+ <!-- start-code-block -->
115+ #### Delphi
116+
117+ ``` delphi
118+
110119procedure TMainForm.btnDesignClick(Sender: TObject);
111120begin
112121 LoadReportFromLayout; // Loads a report layout definition from the database
@@ -119,6 +128,8 @@ begin
119128 dxReport1.ShowViewer; // Displays the Report Viewer
120129end;
121130```
131+ <!-- end-code-block -->
132+
122133
123134
124135### Step 4: Store Report Layouts in a Dataset
@@ -127,7 +138,11 @@ When a user edits and saves a report in the Report Designer,
127138the value of [ TdxReport.Layout] changes and an [ OnLayoutChanged] event is called.
128139Handle this event to save layout changes to the active dataset record.
129140
130- ``` pas
141+ <!-- start-code-block -->
142+ #### Delphi
143+
144+ ``` delphi
145+
131146procedure TMainForm.dxReport1LayoutChanged(ASender: TdxReport);
132147begin
133148 // Start editing the active dataset record:
@@ -141,6 +156,8 @@ begin
141156 DataModule1.mdLayouts.Post;
142157end;
143158```
159+ <!-- end-code-block -->
160+
144161
145162
146163### Step 5: Persist Data between Application Sessions
@@ -150,7 +167,11 @@ This step is applicable only to the memory-based [TdxMemData] datasource.
150167To save the dataset to a file and restore data on app restart,
151168handle ` OnCreate ` and ` OnDestroy ` events of the data module:
152169
153- ``` pas
170+ <!-- start-code-block -->
171+ #### Delphi
172+
173+ ``` delphi
174+
154175const
155176 DataFileName = 'data.dat';
156177
@@ -166,6 +187,8 @@ begin
166187 mdLayouts.SaveToBinaryFile(DataFileName)
167188end;
168189```
190+ <!-- end-code-block -->
191+
169192
170193
171194## Files to Review
0 commit comments