1418393 - How to generate a report with complete Saved Data using Visual Studio .NET.

SAP Knowledge Base Article - Public

1418393 - How to generate a report with complete Saved Data using Visual Studio .NET.

Symptom

rptDoc.Load(reportFileName, OpenReportMethod.OpenReportByTempCopy)
rptDoc.ReportOptions.EnableSaveDataWithReport = True
.
.
.
rptDoc.SaveAs(m_rptDoc.FileName, True)
rptDoc.Close
rptDoc.Dispose 
  • Opening the above generated report in the Crystal Reports designer, results in the error; "The saved data is incomplete. Generate the data to save?"

Cause

The report only runs as much data as needed to create a basic report. Sometimes this may only be first page of a report.

Resolution

  • Need to force the report to retrieve all the data for all the pages in the report.
  • Add the following two lines of code to generate a report with all the pages;
Dim prc As New CrystalDecisions.Shared.ReportPageRequestContext
rptDoc.FormatEngine.GetLastPageNumber(prc)

Keywords

forum thread , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , How To

Product

Crystal Reports 2008 V1