Skip to content
Open
Show file tree
Hide file tree
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
88 changes: 88 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Default Delphi compiler directories
# Content of this directories are generated with each Compile/Construct of a project.
Win32/
Win64/
Win64x/

# Delphi compiler-generated binaries (safe to delete)
*.exe
*.dll
*.bpl
*.bpi
*.dcp
*.so
*.apk
*.drc
*.map
*.dres
*.rsm
*.tds
*.dcu
*.lib
*.a
*.o
*.ocx

# Delphi autogenerated files (duplicated info)
*.cfg
*.hpp
*Resource.rc
*.rsp

# Delphi local files (user-specific info)
*.local
*.identcache
*.projdata
*.tvsconfig
*.dsk
*.dsv

# Delphi history and backups
__history/
__recovery/
*.~*


# ------------------------------------------------------------
# C++Builder specific
# ------------------------------------------------------------

# C++Builder compiler outputs
*.obj
*.hpp
*.ilc
*.ild
*.ilf
*.ils
*.map
*.tds

# Precompiled headers
*.pch

# C++Builder packages and libraries
*.bpl
*.bpi
*.lib
*.a
*.dll
*.so

# C++Builder intermediate / cache files
*.cbproj.local
*.cbproj.identcache
*.cbproj.user
*.cbtemp


# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
*.stat

# Boss dependency manager vendor folder https://github.com/HashLoad/boss
modules/

# Output files
*.pdf
*.docx
*.zip
data.dat
1 change: 0 additions & 1 deletion CPB/uMainForm.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ object MainForm: TMainForm
Width = 377
Height = 25
Caption = 'Design Report'
SpeedButtonOptions.CanBeFocused = False
TabOrder = 1
OnClick = btnDesignClick
end
Expand Down
Binary file added Delphi/ReportTemplate.res
Binary file not shown.
1 change: 0 additions & 1 deletion Delphi/uMainForm.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ object MainForm: TMainForm
Width = 377
Height = 25
Caption = 'Design Report'
SpeedButtonOptions.CanBeFocused = False
TabOrder = 1
OnClick = btnDesignClick
end
Expand Down
59 changes: 51 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,64 @@
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
<!-- default badges end -->
# DevExpress VCL Reports - Store Report Layouts in a Database

This example stores a [report layout](https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout) (XML-based template) in the BLOB field of a memory-based dataset ([TdxMemData](https://docs.devexpress.com/VCL/dxmdaset.TdxMemData) inherited from the [TDataSet](https://docwiki.embarcadero.com/Libraries/Athens/en/Data.DB.TDataSet) class shipped with the standard VCL library).
# DevExpress Reports for Delphi/C++Builder – Store Report Layouts in a Database

## Testing the example
This example application stores [DevExpress report layouts][TdxReport.Layout] in a database.
The application allows users to create and save report layouts, modify existing layouts, and open layouts in Report Designer/Viewer.


The example uses a memory-based dataset as the database used to store layouts.
The dataset is based on the [TdxMemData] component from the DevExpress library,
inherited from the [TDataSet] class shipped with the standard VCL library.

## Test the Example

* Run the sample app and click **New Report** to create an empty database record.
* Click **Show Designer** to display the [Report Designer](https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer) dialog.
* Click **Show Designer** to display the [Report Designer][dx-report-designer] dialog.
* Create a report layout using tools available within the UI.
* Click the hamburger button, select the **Save** option, and close the dialog.
* Close the app. The [TdxMemData](https://docs.devexpress.com/VCL/dxmdaset.TdxMemData) component will store layout data between sessions.
* Run the sample app again. Click **View Designer** to load the saved report layout, or **View Report** to preview a layout-based report in the [Report Viewer](https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer) dialog.
* Close the app. The [TdxMemData] component will store layout data between sessions.
* Run the sample app again. Click **View Designer** to load the saved report layout, or **View Report** to preview a layout-based report in the [Report Viewer][dx-report-viewer] dialog.

## Documentation

* [TdxReport.Layout Property](https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout)
* [TdxBackendDataSetJSONConnection Component](https://docs.devexpress.com/VCL/dxBackend.ConnectionString.JSON.DataSet.TdxBackendDataSetJSONConnection)
- [Introduction to VCL Reports][reports-intro]
- [Tutorial: Create a table report using the Report Wizard][report-wizard]
- [Store report layouts in REPX files at design-time][reports-design-time-store]

- [Use SQLite as a data source for reports (as demonstrated in the current example)][sqlite-data-source]
- API reference:
- [TdxReport.Layout]
- [TdxBackendDatabaseSQLConnection] (used to supply data to reports in the current example)
- [TdxBackendDataSetJSONConnection] (used to store report layouts in the current example)
- [TdxMemData] (used to store layout data between sessions)

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


<!-- reference links -->
[TdxReport.Layout]: https://docs.devexpress.com/VCL/dxReport.TdxReport.Layout
[TdxBackendDatabaseSQLConnection]: https://docs.devexpress.com/VCL/dxBackend.ConnectionString.SQL.TdxBackendDatabaseSQLConnection
[TdxBackendDataSetJSONConnection]: https://docs.devexpress.com/VCL/dxBackend.ConnectionString.JSON.DataSet.TdxBackendDataSetJSONConnection
[TdxMemData]: https://docs.devexpress.com/VCL/dxmdaset.TdxMemData
[TDataSet]: https://docwiki.embarcadero.com/Libraries/Athens/en/Data.DB.TDataSet

<!-- external documentation links -->
<!-- in-repository links -->

## More Examples

- [Store report layouts in REPX files (example application)][file-example]

[file-example]: https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-file

<!-- feedback -->
## Does This Example Address Your Development Requirements/Objectives?

Expand All @@ -31,3 +72,5 @@ This example stores a [report layout](https://docs.devexpress.com/VCL/dxReport.T