vcl-dxreport-dot-tdxreport-bd2dbca5.md
Allows you to customize Report Viewer dialog form settings.
property OnViewerFormShow: TdxBackendFormNotifyEvent read; write;
Handle OnDesignerFormShow and OnViewerFormShow events to customize Report Designer and Report Viewer form settings. You can change caption, dimensions, position, and other settings as demonstrated in the following code example: Modify Report Viewer Form Settings.
The ShowViewer procedure raises the OnViewerFormShow event.
The following parameters are available within an OnViewerFormShow event handler:
ASenderProvides access to the TdxReport component that raised the OnViewerFormShow event.AFormProvides access to the Report Viewer dialog form.
The following code example demonstrates an OnViewerFormShow event handler that modifies caption, dimensions, and position of the Report Viewer dialog when it is displayed:
uses
dxReport; // Declares the TdxReport component
//...
procedure TMyForm.dxReport1ViewerFormShow(ASender: TObject; AForm: TForm);
begin
AForm.Caption := 'My Report Viewer'; // Changes the Report Viewer form caption
AForm.WindowState := wsNormal; // Switches from maximized to the normal form state
AForm.Position := poScreenCenter; // Centers the dialog on the screen
AForm.Width := 1200; // Specifies the dialog width
AForm.Height := 800; // Specifies the dialog height
end;
#include "dxReport.hpp" // Declares the TdxReport component
// Add the following linker directive to the corresponding CPP source file:
#pragma link "dxReport" // Required to use dxReport.hpp declarations
// ...
void __fastcall TMyForm::dxReport1ViewerFormShow(TObject *ASender, TForm *AForm)
{
AForm->Caption = "My Report Viewer"; // Changes the Report Viewer form caption
AForm->WindowState = wsNormal; // Switches from maximized to the normal form state
AForm->Position = poScreenCenter; // Centers the dialog on the screen
AForm->Width = 1200; // Specifies the dialog width
AForm->Height = 800; // Specifies the dialog height
}
See Also