You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# DevExpress VCL Reports—Generate a PDF Report Using a Headless (non-GUI) application
7
+
# DevExpress VCL Reports — Generate a Report Using a Headless (non-GUI) Application
8
8
9
-
This example uses the DevExpress VCL Reports components to generate a PDF report using a command line application.
10
-
The example demonstrates the capabilities of VCL Reports for producing reports in backend applications, webservers, or command line applications, all without the need for a GUI.
9
+
This example uses the DevExpress VCL Reports to generate a PDF report using a command line application.
10
+
The example demonstrates the capabilities of VCL Reports for producing reports in backend applications, Windows services,
11
+
or plain command line applications, all without the need for a GUI.
11
12
12
-
The example includes projects for both [Delphi](./Delphi) and [C++Builder](./CPB).
13
+
> 
13
14
14
-
> 
// Export a report to PDF format and save it to a memory stream
110
+
AReport.ExportToPDF(AStream);
111
+
// Write the content of the memory stream to a file
112
+
AStream.SaveToFile('Order_11077.pdf');
113
+
finally
114
+
AStream.Free;
115
+
end;
116
+
```
117
+
118
+
### Export Multiple Reports
119
+
120
+
Headless approach allows you to efficiently export multiple reports using the same layout and data, but different parameter combinations.
121
+
Repeat steps 3 and 4 for each parameter combination.
122
+
123
+
**Delphi:**
124
+
125
+
```pas
126
+
// Find each report parameter
127
+
for AReportParameter in AReport.Parameters do
128
+
if AReportParameter.Name = 'OrderIdParameter' then
129
+
AOrderParameter := AReportParameter;
130
+
131
+
for OrderID in OrderIDList:
132
+
// Assign values to report parameters
133
+
AOrderParameter.Value = OrderID;
134
+
// Proceed with step 4
135
+
```
38
136
39
137
40
138
## Files to Review
@@ -44,11 +142,16 @@ This example loads a report layout from the [`Order.repx`](./Order.repx) file.
44
142
You view and edit this file using the [file storage example application](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-file).
45
143
-[`nwind.db`](./nwind.db) contains the Northwind example database.
-[Example: Store Report Layouts within Text Files](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-file)
51
-
-[Example: Store Report Layouts in a Database](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-database)
148
+
-[Introduction to VCL Reports](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports)
149
+
-[Tutorial: Create a table report using the Report Wizard](https://docs.devexpress.com/VCL/405760/ExpressReports/getting-started/create-table-report-using-report-wizard)
150
+
-[How to store report layouts in REPX files (example application)](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-file)
151
+
-[How to store report layouts in a database (example application)](https://github.com/DevExpress-Examples/vcl-reports-store-layout-template-database)
152
+
-[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)
0 commit comments