ReportDocument.SaveAs Method (String,Boolean)

Saves the report and its data into the specified file.

Namespace CrystalDecisions.CrystalReports.Engine Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

Syntax

'Declaration
Public Overrideable Sub SaveAs ( _
    ByVal filename As String, _ 
    ByVal saveDataWithReport As Boolean _   
) 
public virtual void SaveAs (
    string filename,
    bool saveDataWithReport
)

Parameters

  • filename
    Indicates the path and filename of the report.
  • saveDataWithReport
    Indicates whether or not the report data will be saved.

Remarks

If the Boolean parameter variable is set to true, the report is saved with the data. If the file path or file extension is not specified by the file name, by default, the report is saved to your local hard drive, with the .rpt file extension.

Example

This example saves the report with data.

'Declaration

      Private Sub SaveReport(ByVal reportName As String)
         myReportDocument.SaveAs(reportName, True)
      End Sub
      
      void SaveReport(String* reportName)
      {
         reportDocument->SaveAs(reportName, true);
      }
      
      private void SaveReport(string reportName)
      {
         reportDocument.SaveAs(reportName, true);
      }
      

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports .NET 10

See Also

Reference

ReportDocument Class
ReportDocument Members
CrystalDecisions.CrystalReports.Engine Namespace