Share via


ReportDocument.HasSavedData Property

Gets whether the report has data saved in memory.

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

Syntax

'Declaration

Public Overrideable ReadOnly Property HasSavedData As Boolean
public virtual bool HasSavedData {get;}

Example

This example reloads a report. Before reloading, it warns the user if any saved data will be discarded.

'Declaration

      Private Sub ReloadReport(ByVal myReportDocument As ReportDocument)
         If myReportDocument.IsLoaded = True Then
           Dim autoSaveData As Boolean = myReportDocument.ReportOptions.EnableSaveDataWithReport
           myReportDocument.EnableEventLog(EventLogLevel.LogEngineErrors)
           If autoSaveData = False And myReportDocument.HasSavedData = True Then
             MsgBox("Discarding unsaved data in the report")
           End If
           myReportDocument.Refresh()
           myReportDocument.VerifyDatabase()
         End If
      End Sub
      
      private void ReloadReport(ReportDocument reportDocument)
      {
        if (reportDocument.IsLoaded)
        {
          bool autoSaveData = reportDocument.ReportOptions.EnableSaveDataWithReport;
          ReportDocument.EnableEventLog(EventLogLevel.LogEngineErrors);
          if (!autoSaveData && reportDocument.HasSavedData)
          {
            MessageBox.Show("Discarding unsaved data in the report");
          }
          reportDocument.Refresh();
          reportDocument.VerifyDatabase();
        }
      }
      

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