TdxReport.ShowDesigner Method
Displays the Report Designer dialog.
Declaration
procedure ShowDesigner;
Remarks
Call ShowDesigner
and ShowViewer procedures to display Web-based Report Designer and Report Viewer dialogs. Global skin and palette settings defined using the Project Settings dialog or a TdxSkinController component affect both TdxReport dialogs.
The Report Designer dialog allows users to design and configure the current report template, including placeholder positions, source dataset fields, appearance settings, etc. All saved changes made in this dialog update the Layout property value and raise the OnLayoutChanged event. For example, you can handle this event to save report template changes to a file.
Note
A ShowDesigner
procedure call always displays an empty report template in the Report Designer dialog if the ReportName property is unspecified. Every time you save pending changes in the Report Designer dialog, Layout and ReportName property values are updated automatically.
Code Examples
Related GitHub-Hosted Example Projects
Connect to an SQL Database and Display Report Designer
The following code example uses the TdxReportDatabaseSQLConnection component to connect to a demo database (nwind.mdb), displays the Report Designer
dialog, and saves all changes made to the UserReport.repx file:
uses
dxReport, // Declares the TdxReport component and related types
dxReport.ConnectionString.SQL; // Declares the TdxReportDatabaseSQLConnection component
// ...
procedure TMyForm.Button1Click(Sender: TObject);
var
ADataConnection: TdxReportDatabaseSQLConnection;
AReport: TdxReport;
begin
ADataConnection := TdxReportDatabaseSQLConnection.Create(Self);
try
ADataConnection.Name := 'DataConnection';
// Specify a connection string required to connect to a demo database (nwind.mdb)
ADataConnection.ConnectionString := 'XpoProvider=MSAccess;Provider=Microsoft.ACE.OLEDB.12.0;' +
'Data Source=C:\Users\Public\Documents\DevExpress VCL Demos\' +
'MegaDemos\Product Demos\ExpressPivotGrid\Data\nwind.mdb';
AReport := TdxReport.Create(Self);
try
AReport.ShowDesigner; // Displays the Web-based Report Designer dialog
AReport.Layout.SaveToFile('UserReport.repx'); // Saves the report template state to a file
finally
AReport.Free;
end;
finally
ADataConnection.Free;
end;
end;