Skip to content

Commit 48c5f26

Browse files
committed
readme: Add example and reference links
- Refactor the links structure to simplify maintenance. - Bring the file and code entity links to the DevExpress standard. - Add meta-markup to the code snippet blocks. Experimental markup to improve example import to the DevExpress Support Center.
1 parent aae84ff commit 48c5f26

1 file changed

Lines changed: 57 additions & 27 deletions

File tree

README.md

Lines changed: 57 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
66
<!-- default badges end -->
77

8-
# DevExpress&nbsp;VCL&nbsp;Reports&nbsp;– Import&nbsp;and&nbsp;Save Report&nbsp;Layouts to XML&nbsp;Files
8+
# DevExpress Reports for Delphi/C++Builder – Import and Save Report Layouts to XML Files
99

10-
This example uses XML-based REPX files as [report layout](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports) storage.
10+
This example uses XML-based REPX files as [report layout][vcl-reports] storage.
1111

1212
Run the app and execute the following actions:
1313

@@ -20,19 +20,20 @@ Run the app and execute the following actions:
2020

2121
## Prerequisites
2222

23-
[DevExpress Reports Prerequisites](https://docs.devexpress.com/VCL/405773/ExpressCrossPlatformLibrary/vcl-backend/reports-dashboards-app-deployment#vcl-reportsdashboards-prerequisites)
23+
[DevExpress Reports Prerequisites][req]
24+
25+
[req]: https://docs.devexpress.com/VCL/405773/ExpressCrossPlatformLibrary/vcl-backend/reports-dashboards-app-deployment#vcl-reportsdashboards-prerequisites
2426

2527

2628
## Implementation Details
2729

2830
### Import a Report Layout from a File
2931

30-
To import (load) a report layout from a file, call the
31-
[`Layout.LoadFromFile`](https://docwiki.embarcadero.com/Libraries/Athens/en/System.Classes.TStrings.LoadFromFile)
32-
method and assign a name to the
33-
[`ReportName`](https://docs.devexpress.com/VCL/dxReport.TdxReport.ReportName) property:
32+
To import (load) a report layout from a file, call the [Layout.LoadFromFile]
33+
method and assign a name to the [ReportName] property:
3434

35-
**Delphi:**
35+
<!-- start-code-block -->
36+
#### Delphi
3637
```delphi
3738
procedure TMainForm.ImportReport(const AFileName: string);
3839
begin
@@ -43,7 +44,7 @@ begin
4344
end;
4445
```
4546

46-
**C++Builder:**
47+
#### C++Builder
4748
```cpp
4849
void __fastcall TMainForm::ImportReport(const String &FileName)
4950
{
@@ -53,17 +54,18 @@ void __fastcall TMainForm::ImportReport(const String &FileName)
5354
dxReport1->ReportName = ChangeFileExt(ExtractFileName(FileName), "");
5455
}
5556
```
57+
<!-- end-code-block -->
5658
5759
> [!Note]
5860
> An internal report name may differ from the source REPX file name.
5961
6062
6163
### Save a Report Layout to a File
6264
63-
To save the current report layout to a file, call the
64-
[`Layout.SaveToFile`](https://docwiki.embarcadero.com/Libraries/Athens/en/System.Classes.TStrings.SaveToFile) method:
65+
To save the current report layout to a file, call the [Layout.SaveToFile] method:
6566
66-
**Delphi:**
67+
<!-- start-code-block -->
68+
#### Delphi
6769
```delphi
6870
procedure TMainForm.SaveReport(const AFileName: string);
6971
begin
@@ -72,14 +74,15 @@ begin
7274
end;
7375
```
7476

75-
**C++Builder:**
77+
#### C++Builder
7678
```cpp
7779
void __fastcall TMainForm::SaveReport(const String &FileName)
7880
{
7981
// Save the report layout to a file
8082
dxReport1->Layout->SaveToFile(FileName);
8183
}
8284
```
85+
<!-- end-code-block -->
8386
8487
> [!Note]
8588
> Internal report names are not stored in REPX files.
@@ -89,20 +92,20 @@ void __fastcall TMainForm::SaveReport(const String &FileName)
8992
9093
### Modify the Pre-loaded Layout and Save to a New File
9194
92-
The example application loads a predefined layout at startup: `TableReport.repx`.
95+
The example application loads a predefined layout at startup: [TableReport.repx].
9396
You can modify this preloaded report layout and then save changes to a REPX file.
9497
9598
1. Build and run the sample application.
9699
Note the preloaded layout's name in the application's caption.
97100
2. Click **Open Designer** to edit the loaded layout in the DevExpress
98-
[Report Designer](https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer).
101+
[Report Designer][designer].
99102
Modify the layout as you see fit.
100103
3. Once you have made changes in the **Report Designer** dialog, click the hamburger button, select **Save**, and close the dialog.
101104
4. Click **Save to File** to save the report layout to a REPX file.
102105
You can overwrite an existing file or create a new file.
103106
5. Restart the application and click **Import from File** to import a report layout from the previously saved REPX file.
104107
6. Click **Open Viewer** to display the imported layout in the DevExpress
105-
[Report Viewer](https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer).
108+
[Report Viewer][viewer].
106109
107110
108111
### Create, Design, and Save a New Layout
@@ -111,27 +114,54 @@ You can design a new layout from scratch and then save it to a REPX file:
111114
112115
1. Build and run the sample application.
113116
2. Click **Create New** to open a new blank report layout in the DevExpress
114-
[Report Designer](https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer).
117+
[Report Designer][designer].
115118
3. Design the report layout (template) using tools available in the **Report Designer**.
116-
Follow the tutorial: [Create a table report using the Report Wizard](https://docs.devexpress.com/VCL/405760/ExpressReports/getting-started/create-table-report-using-report-wizard).
119+
Follow the tutorial: [Create a table report using the Report Wizard][wizard-tutorial].
117120
4. Once you have made all necessary changes in the **Report Designer** dialog, click the hamburger button, select **Save**, and enter a report layout name.
118121
Click **Save** and close the dialog.
119122
5. Click **Save to File** to save the report layout to a REPX file.
120123
6. Restart the application and click **Import from File** to import a report layout from the previously saved REPX file.
121124
7. Click **Open Viewer** to display the imported layout in the DevExpress
122-
[Report Viewer](https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer).
125+
[Report Viewer][viewer].
126+
127+
128+
## Files to Review
129+
130+
- [uMainForm.pas] (Delphi) and [uMainForm.cpp] (C++Builder) import and save report layouts to REPX files.
131+
- [TableReport.repx] contains a report layout designed to generate a customer order report.
132+
133+
[uMainForm.pas]: ./Delphi/uMainForm.pas
134+
[uMainForm.cpp]: ./CPB/uMainForm.cpp
135+
[TableReport.repx]: ./Table%20Report.repx
136+
137+
## Documentation
138+
139+
- [Introduction to VCL Reports][vcl-reports]
140+
- [Tutorial: Create a table report using the Report Wizard][wizard-tutorial]
141+
- [Store report layouts in REPX files at design-time](https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout#string-list-editor)
142+
- [Use SQLite as a data source for reports (as demonstrated in the current example)](https://docs.devexpress.com/VCL/405750/ExpressCrossPlatformLibrary/vcl-backend/database-engines/vcl-backend-sqlite-support)
143+
- API reference:
144+
- [TdxReport.Layout]
145+
- [TdxReport.Layout.LoadFromFile][Layout.LoadFromFile]
146+
- [TdxReport.Layout.SaveToFile][Layout.SaveToFile]
147+
- [TdxReport.ReportName][ReportName]
148+
- [TdxBackendDatabaseSQLConnection]
123149
150+
[vcl-reports]: https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports
151+
[designer]: https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer
152+
[viewer]: https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer
153+
[wizard-tutorial]: https://docs.devexpress.com/VCL/405760/ExpressReports/getting-started/create-table-report-using-report-wizard
124154
125-
## Documentation and Examples
155+
[TdxReport.Layout]: https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout
156+
[Layout.LoadFromFile]: https://docwiki.embarcadero.com/Libraries/Athens/en/System.Classes.TStrings.LoadFromFile
157+
[Layout.SaveToFile]: https://docwiki.embarcadero.com/Libraries/Athens/en/System.Classes.TStrings.SaveToFile
158+
[ReportName]: https://docs.devexpress.com/VCL/dxReport.TdxReport.ReportName
159+
[TdxBackendDatabaseSQLConnection]: https://docs.devexpress.com/VCL/dxBackend.ConnectionString.SQL.TdxBackendDatabaseSQLConnection
126160
127-
- [Introduction to VCL Reports](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports)
128-
- [Tutorial: Create a table report using the Report Wizard](https://docs.devexpress.com/VCL/405760/ExpressReports/getting-started/create-table-report-using-report-wizard)
129-
- [How to store report layouts in REPX files at design-time](https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout#string-list-editor)
130-
- [How to store report layouts in a database (example application)](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-database)
131-
- [How to use SQLite as a data source for reports (as demonstrated in the current example)](https://docs.devexpress.com/VCL/405750/ExpressCrossPlatformLibrary/vcl-backend/database-engines/vcl-backend-sqlite-support)
132-
- [API reference: `TdxReport.Layout` Property](https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout)
133-
- [API reference: `TdxBackendDatabaseSQLConnection` Component](https://docs.devexpress.com/VCL/dxBackend.ConnectionString.SQL.TdxBackendDatabaseSQLConnection)
161+
## More Examples
134162
163+
- [Store DevExpress VCL Report Layouts in a Database](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-database)
164+
- [Localize the DevExpress VCL Report Viewer and Report Designer UI](https://github.com/DevExpress-Examples/vcl-reports-localize)
135165
136166
<!-- feedback -->
137167
## Does This Example Address Your Development Requirements/Objectives?

0 commit comments

Comments
 (0)