Skip to content

Commit 0049c55

Browse files
committed
readme: Apply standard code formatting
1 parent d170f36 commit 0049c55

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ This example project uses a SQLite sample database ([nwind.db]) as the report's
8282
To load a layout definition to the [TdxReport] component, you must specify
8383
report name ([TdxReport.ReportName]) and layout ([TdxReport.Layout]):
8484

85-
```pas
85+
<!-- start-code-block -->
86+
#### Delphi
87+
88+
```delphi
89+
8690
procedure TMainForm.LoadReportNameAndLayout();
8791
begin
8892
// Ensure that the dataset has at least one record or a new record is being created:
@@ -96,6 +100,7 @@ begin
96100
dxReport1.Layout.Assign(DataModule1.mdLayoutsLayout);
97101
end;
98102
```
103+
<!-- end-code-block -->
99104

100105
To load a different report, assign a new report name and layout.
101106
The assigned report replaces the current layout definition.
@@ -106,7 +111,11 @@ The assigned report replaces the current layout definition.
106111
Once you assigned a name and layout to the [TdxReport] component,
107112
you 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+
110119
procedure TMainForm.btnDesignClick(Sender: TObject);
111120
begin
112121
LoadReportFromLayout; // Loads a report layout definition from the database
@@ -119,6 +128,8 @@ begin
119128
dxReport1.ShowViewer; // Displays the Report Viewer
120129
end;
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,
127138
the value of [TdxReport.Layout] changes and an [OnLayoutChanged] event is called.
128139
Handle this event to save layout changes to the active dataset record.
129140

130-
```pas
141+
<!-- start-code-block -->
142+
#### Delphi
143+
144+
```delphi
145+
131146
procedure TMainForm.dxReport1LayoutChanged(ASender: TdxReport);
132147
begin
133148
// Start editing the active dataset record:
@@ -141,6 +156,8 @@ begin
141156
DataModule1.mdLayouts.Post;
142157
end;
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.
150167
To save the dataset to a file and restore data on app restart,
151168
handle `OnCreate` and `OnDestroy` events of the data module:
152169

153-
```pas
170+
<!-- start-code-block -->
171+
#### Delphi
172+
173+
```delphi
174+
154175
const
155176
DataFileName = 'data.dat';
156177
@@ -166,6 +187,8 @@ begin
166187
mdLayouts.SaveToBinaryFile(DataFileName)
167188
end;
168189
```
190+
<!-- end-code-block -->
191+
169192

170193

171194
## Files to Review

0 commit comments

Comments
 (0)