Skip to content

Commit f8e014e

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

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ 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
8689
procedure TMainForm.LoadReportNameAndLayout();
8790
begin
8891
// Ensure that the dataset has at least one record or a new record is being created:
@@ -96,6 +99,7 @@ begin
9699
dxReport1.Layout.Assign(DataModule1.mdLayoutsLayout);
97100
end;
98101
```
102+
<!-- end-code-block -->
99103

100104
To load a different report, assign a new report name and layout.
101105
The assigned report replaces the current layout definition.
@@ -106,7 +110,10 @@ The assigned report replaces the current layout definition.
106110
Once you assigned a name and layout to the [TdxReport] component,
107111
you 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
110117
procedure TMainForm.btnDesignClick(Sender: TObject);
111118
begin
112119
LoadReportFromLayout; // Loads a report layout definition from the database
@@ -119,6 +126,8 @@ begin
119126
dxReport1.ShowViewer; // Displays the Report Viewer
120127
end;
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,
127136
the value of [TdxReport.Layout] changes and an [OnLayoutChanged] event is called.
128137
Handle this event to save layout changes to the active dataset record.
129138

130-
```pas
139+
<!-- start-code-block -->
140+
#### Delphi
141+
142+
```delphi
131143
procedure TMainForm.dxReport1LayoutChanged(ASender: TdxReport);
132144
begin
133145
// Start editing the active dataset record:
@@ -141,6 +153,8 @@ begin
141153
DataModule1.mdLayouts.Post;
142154
end;
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.
150164
To save the dataset to a file and restore data on app restart,
151165
handle `OnCreate` and `OnDestroy` events of the data module:
152166

153-
```pas
167+
<!-- start-code-block -->
168+
#### Delphi
169+
170+
```delphi
154171
const
155172
DataFileName = 'data.dat';
156173
@@ -166,6 +183,8 @@ begin
166183
mdLayouts.SaveToBinaryFile(DataFileName)
167184
end;
168185
```
186+
<!-- end-code-block -->
187+
169188

170189

171190
## Files to Review

0 commit comments

Comments
 (0)