Share via


ReportDocument.Load Method (String)

Loads a new report. If a report is already loaded, then it is closed and a new one is opened.

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

Syntax

'Declaration
Public Overrideable Sub Load ( _
    ByVal filename As String _  
) 
public virtual void Load (
    string filename
)

Parameters

  • filename
    Indicates the path and filename of the report.

Remarks

By default, the report is opened as a temporary copy.

Example

This example loads and previews the report.

'Declaration

      Private Sub LoadReport(ByVal reportName As String)
         Dim myReportDocument As New ReportDocument()
         myReportDocument.Load(reportName)
         MyCrystalReportViewer.ReportSource = myReportDocument
      End Sub
      
      void LoadReport(String* reportName)
      {
      ReportDocument * reportDocument = new ReportDocument();

         reportDocument->Load(reportName);
         crystalReportViewer->ReportSource = reportDocument;
      };
      
      private void LoadReport(string reportName)
      {
         ReportDocument reportDocument = new ReportDocument();

         reportDocument.Load(reportName);
         crystalReportViewer.ReportSource = reportDocument;
      }
      

Version Information

Crystal Reports Basic for Visual Studio 2008

Supported since: Crystal Reports for Visual Studio .NET 2002

See Also

Reference

ReportDocument Class
ReportDocument Members
CrystalDecisions.CrystalReports.Engine Namespace