Skip to main content
All docs
V26.1
  • TdxCustomReportControl.ReportName Property

    Specifies the report name.

    Declaration

    property ReportName: string read; write;

    Property Value

    Type Description
    string

    The report name.

    Remarks

    Use the ReportName property to define a report name for export operations when the Layout property contains a non-empty report template definition. Report Viewer and Report Designer dialogs also display the ReportName property value in the form caption.

    Code Example: Export Report Content to PDF File

    The following code example exports content of a configured TdxReportControl component to a file in the Portable Document (PDF) format using an intermediary TMemoryStream object:

    uses
      dxReport.Control,  // Declares the TdxReportControl component
      dxSplashForms,     // Declares the TdxSplashFormManager class and related types
      dxShellDialogs;    // Declares the TdxSaveFileDialog component
    // ...
    
    procedure TMyForm.cxButtonExportToPDFClick(Sender: TObject);
    var
      AStream: TMemoryStream;
    begin
      if not dxSaveFileDialog1.Execute(Handle) then Exit;  // Displays the "Save File" dialog
      AStream := TMemoryStream.Create;       // Creates a stream as an intermediary container
      // Displays a Wait Form before the export operation
      TdxSplashFormManager.WaitForm.Show(dxReportControl1.Parent);
      try
        dxReportControl1.ExportToPDF(AStream);   // Exports content to a stream in the PDF format
        AStream.SaveToFile(dxSaveFileDialog1.FileName);    // Saves PDF stream content to a file
      finally
        AStream.Free;                        // Releases the intermediary memory stream
        TdxSplashFormManager.WaitForm.Hide;  // Hides the Wait Form once the operation is complete
      end;
    end;
    
    See Also