@@ -82,7 +82,10 @@ 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
8689procedure TMainForm.LoadReportNameAndLayout();
8790begin
8891 // Ensure that the dataset has at least one record or a new record is being created:
9699 dxReport1.Layout.Assign(DataModule1.mdLayoutsLayout);
97100end;
98101```
102+ <!-- end-code-block -->
99103
100104To load a different report, assign a new report name and layout.
101105The assigned report replaces the current layout definition.
@@ -106,7 +110,10 @@ The assigned report replaces the current layout definition.
106110Once you assigned a name and layout to the [ TdxReport] component,
107111you can display [ Report Designer] [ dx-report-designer ] and [ Report Viewer] [ dx-report-viewer ] dialogs:
108112
109- ``` pas
113+ <!-- start-code-block -->
114+ #### Delphi
115+
116+ ``` delphi
110117procedure TMainForm.btnDesignClick(Sender: TObject);
111118begin
112119 LoadReportFromLayout; // Loads a report layout definition from the database
@@ -119,6 +126,8 @@ begin
119126 dxReport1.ShowViewer; // Displays the Report Viewer
120127end;
121128```
129+ <!-- end-code-block -->
130+
122131
123132
124133### Step 4: Store Report Layouts in a Dataset
@@ -127,7 +136,10 @@ When a user edits and saves a report in the Report Designer,
127136the value of [ TdxReport.Layout] changes and an [ OnLayoutChanged] event is called.
128137Handle this event to save layout changes to the active dataset record.
129138
130- ``` pas
139+ <!-- start-code-block -->
140+ #### Delphi
141+
142+ ``` delphi
131143procedure TMainForm.dxReport1LayoutChanged(ASender: TdxReport);
132144begin
133145 // Start editing the active dataset record:
@@ -141,6 +153,8 @@ begin
141153 DataModule1.mdLayouts.Post;
142154end;
143155```
156+ <!-- end-code-block -->
157+
144158
145159
146160### Step 5: Persist Data between Application Sessions
@@ -150,7 +164,10 @@ This step is applicable only to the memory-based [TdxMemData] datasource.
150164To save the dataset to a file and restore data on app restart,
151165handle ` OnCreate ` and ` OnDestroy ` events of the data module:
152166
153- ``` pas
167+ <!-- start-code-block -->
168+ #### Delphi
169+
170+ ``` delphi
154171const
155172 DataFileName = 'data.dat';
156173
@@ -166,6 +183,8 @@ begin
166183 mdLayouts.SaveToBinaryFile(DataFileName)
167184end;
168185```
186+ <!-- end-code-block -->
187+
169188
170189
171190## Files to Review
0 commit comments