vcl-dxreport-ffd1c254.md
The procedural type for general report-related notification events.
TdxReportNotifyEvent = procedure(ASender: TdxReport) of object;
| Name | Type | Description |
|---|---|---|
| ASender | TdxReport |
Provides access to the report generator component that raised the notification event.
|
Handle report-related notification events to execute custom code in response to certain changes in your ExpressReports-powered application.
The following code example saves the current report to a REPX file every time a user saves pending changes in the Report Designer dialog:
uses
dxReport; // Declares the TdxReport class
// ...
procedure TMyForm.dxReport1LayoutChanged(ASender: TdxReport);
begin
ASender.Layout.SaveToFile(ASender.ReportName + '.repx');
end;
#include "dxReport.hpp" // Declares the TdxReport class
// Add the following linker directive to the corresponding CPP source file:
#pragma link "dxReport" // Required to use dxReport.hpp declarations
// ..
void __fastcall TMyForm::dxReport1LayoutChanged(TdxReport *ASender)
{
ASender->Layout->SaveToFile(ASender->ReportName + ".repx");
}
The following code example saves the current report to an existing BLOB dataset field every time a user saves pending changes in the Report Designer dialog:
uses
dxReport, // Declares the TdxReport class
dxmdaset; // Declares the TdxMemData class and related types
// ...
procedure TMyForm.dxReport1LayoutChanged(ASender: TdxReport);
begin
dxMemData1.Edit;
dxMemData1.FieldByName('TemplateName').AsString := ASender.ReportName;
dxMemData1.FieldByName('TemplateLayout').Assign(ASender.Layout);
dxMemData1.Post;
end;
#include "dxReport.hpp" // Declares the TdxReport class
#include "dxmdaset.hpp" // Declares the TdxMemData class and related types
// Add the following linker directives to the corresponding CPP source file:
#pragma link "dxReport" // Required to use dxReport.hpp declarations
#pragma link "dxmdaset" // Required to use dxmdaset.hpp declarations
// ...
void __fastcall TMyForm::dxReport1LayoutChanged(TdxReport *ASender)
{
dxMemData1->Edit();
dxMemData1->FieldByName("TemplateName")->AsString = ASender->ReportName;
dxMemData1->FieldByName("TemplateLayout")->Assign(ASender->Layout);
dxMemData1->Post();
}
The TdxReport.OnLayoutChanged event references the TdxReportNotifyEvent procedural type.
See Also
TdxReportExportEvent Procedural Type
TdxReportPrintPreviewEvent Procedural Type