Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 62 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

# DevExpress Reports for Delphi/C++Builder – Import and Save Report Layouts to XML Files

This example uses XML-based REPX files as [report layout][vcl-reports] storage.
This example uses XML-based REPX files as [report layout][reports-intro] storage.

Run the app and execute the following actions:

- Customize our predefined layout and save it to a new file.

Check warning on line 14 in README.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.md#L14

[Microsoft.We] Only use we/us when you refer to our organization.
Raw output
{"message": "[Microsoft.We] Only use we/us when you refer to our organization.", "location": {"path": "README.md", "range": {"start": {"line": 14, "column": 15}}}, "severity": "WARNING"}
- Create a new report layout and save it to a file.
- Import a report layout you created earlier from a file.

Expand All @@ -26,6 +26,43 @@
[req]: https://docs.devexpress.com/VCL/405773/ExpressCrossPlatformLibrary/vcl-backend/reports-dashboards-app-deployment#vcl-reportsdashboards-prerequisites


## Test the Example

### Modify and Save the Pre-loaded Layout to a New File

The example application loads a predefined layout at startup: [TableReport.repx].
You can modify this preloaded report layout and save changes to a REPX file.

1. Build and run the sample application.
Note that the app window caption displays the preloaded layout's name.
2. Click **Open Designer** to edit the loaded layout in the DevExpress
[Report Designer][designer].
Modify the layout as you see fit.
3. Click the hamburger button, select **Save**, and close the dialog.
4. Click **Save to File** to save the report layout to a REPX file.
You can overwrite an existing file or create a new file.
5. Restart the application and click **Import from File** to import a report layout from the previously saved REPX file.
6. Click **Open Viewer** to display the imported layout in the DevExpress
[Report Viewer][viewer].


### Create, Design, and Save a New Layout

You can design a new layout from scratch and save it to a REPX file:

1. Build and run the sample application.
2. Click **Create New** to open a new blank report layout in the DevExpress
[Report Designer][designer].
3. Design the report layout (template) using tools available in the Report Designer.
Follow the tutorial: [Create a table report using the Report Wizard][wizard-tutorial].
4. Click the hamburger button, select **Save**, and input a report layout name.
Click **Save** and close the dialog.
5. Click **Save to File** to save the report layout to a REPX file.
6. Restart the application and click **Import from File** to import a report layout from the previously saved REPX file.
7. Click **Open Viewer** to display the imported layout in the DevExpress
[Report Viewer][viewer].


## Implementation Details

### Import a Report Layout from a File
Expand Down Expand Up @@ -89,43 +126,6 @@
> Internal report names are not stored in REPX files.


## Test the Example

### Modify the Pre-loaded Layout and Save to a New File

The example application loads a predefined layout at startup: [TableReport.repx].
You can modify this preloaded report layout and then save changes to a REPX file.

1. Build and run the sample application.
Note the preloaded layout's name in the application's caption.
2. Click **Open Designer** to edit the loaded layout in the DevExpress
[Report Designer][designer].
Modify the layout as you see fit.
3. Once you have made changes in the **Report Designer** dialog, click the hamburger button, select **Save**, and close the dialog.
4. Click **Save to File** to save the report layout to a REPX file.
You can overwrite an existing file or create a new file.
5. Restart the application and click **Import from File** to import a report layout from the previously saved REPX file.
6. Click **Open Viewer** to display the imported layout in the DevExpress
[Report Viewer][viewer].


### Create, Design, and Save a New Layout

You can design a new layout from scratch and then save it to a REPX file:

1. Build and run the sample application.
2. Click **Create New** to open a new blank report layout in the DevExpress
[Report Designer][designer].
3. Design the report layout (template) using tools available in the **Report Designer**.
Follow the tutorial: [Create a table report using the Report Wizard][wizard-tutorial].
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.
Click **Save** and close the dialog.
5. Click **Save to File** to save the report layout to a REPX file.
6. Restart the application and click **Import from File** to import a report layout from the previously saved REPX file.
7. Click **Open Viewer** to display the imported layout in the DevExpress
[Report Viewer][viewer].


## Files to Review

- [uMainForm.pas] (Delphi) and [uMainForm.cpp] (C++Builder) import and save report layouts to REPX files.
Expand All @@ -137,22 +137,27 @@

## Documentation

- [Introduction to VCL Reports][vcl-reports]
- [Introduction to VCL Reports][reports-intro]
- [Tutorial: Create a table report using the Report Wizard][wizard-tutorial]
- [Store report layouts in REPX files at design-time](https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout#string-list-editor)
- [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)
- [Use SQLite as a data source for reports (as demonstrated in the current example)][sqlite-data-source]
- [Store report layouts in REPX files at design-time][reports-design-time-store]
- API reference:
- [TdxReport.Layout]
- [TdxReport.Layout] (an XML-based layout template that can be stored in a file)
- [TdxReport.Layout.LoadFromFile][Layout.LoadFromFile]
- [TdxReport.Layout.SaveToFile][Layout.SaveToFile]
- [TdxReport.ReportName][ReportName]
- [TdxBackendDatabaseSQLConnection]
- [TdxReport.ReportName][ReportName] (internal report name that is not included in the layout)
- [TdxBackendDatabaseSQLConnection] (supplies data to reports)

[vcl-reports]: https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports

<!-- documentation links -->
[reports-intro]: https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports
[designer]: https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer
[viewer]: https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer
[wizard-tutorial]: https://docs.devexpress.com/VCL/405760/ExpressReports/getting-started/create-table-report-using-report-wizard
[sqlite-data-source]: https://docs.devexpress.com/VCL/405750/ExpressCrossPlatformLibrary/vcl-backend/database-engines/vcl-backend-sqlite-support
[reports-design-time-store]: https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout#string-list-editor

<!-- reference links -->
[TdxReport.Layout]: https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout
[Layout.LoadFromFile]: https://docwiki.embarcadero.com/Libraries/Athens/en/System.Classes.TStrings.LoadFromFile
[Layout.SaveToFile]: https://docwiki.embarcadero.com/Libraries/Athens/en/System.Classes.TStrings.SaveToFile
Expand All @@ -161,8 +166,16 @@

## More Examples

- [Store DevExpress VCL Report Layouts in a Database](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-database)
- [Localize the DevExpress VCL Report Viewer and Report Designer UI](https://github.com/DevExpress-Examples/vcl-reports-localize)
- [Store report layouts in a database][database-example]
- [Filter data records in a report][filter-data-records]
- [Generate reports in a backend / service application][non-interactive-export]
- [Localize the Report Viewer and Report Designer UI][localize]

<!-- example links -->
[database-example]: https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-database
[filter-data-records]: https://github.com/DevExpress-Examples/vcl-filter-report-preview-based-on-grid-selected-rows
[non-interactive-export]: https://github.com/DevExpress-Examples/vcl-reports-non-interactive-export
[localize]: https://github.com/DevExpress-Examples/vcl-reports-localize

<!-- feedback -->
## Does This Example Address Your Development Requirements/Objectives?
Expand All @@ -171,3 +184,5 @@

(you will be redirected to DevExpress.com to submit your response)
<!-- feedback end -->


Loading