Symptom
- Exporting a report to Crystal Reports format using the Crystal Reports .NET SDK.
- An exception is thrown.
System.Runtime.InteropServices.COMException was unhandled
Message=
Unsupported exporting format for RPTR.
af53c511-99ea-41c1-850c-db9228b38470 {3D257F0A-9400-42D4-A94C-9FB4DD2DAC31}.rpt
Source=""
ErrorCode=-2147482612
StackTrace:
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)
at crystalTest1.Form1.ConfigureCrystalReports() in C:\Users\Administrator\Documents\Visual Studio 2010\Projects\crystalTest1\crystalTest1\Form1.cs:line 41
at crystalTest1.Form1..ctor() in C:\Users\Administrator\Documents\Visual Studio 2010\Projects\crystalTest1\crystalTest1\Form1.cs:line 19
at crystalTest1.Program.Main() in C:\Users\Administrator\Documents\Visual Studio 2010\Projects\crystalTest1\crystalTest1\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Environment
- Windows OS
- Visual Studio 2010
- Crystal Reports for Visual Studio 2010, RTM
Reproducing the Issue
- Use the ReportDocument.ExportToDisk() method to export a report to Crystal Reports format.
m_ReportDocument.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.CrystalReport, "C:\\windows\\temp\\~crystal.rpt");
Cause
- This error is thrown purposely because the report attempting to be exported is Crystal Reports Read Only (*.rptr).
- To protect the security of the RPTR format, you cannot export it to Crystal Reports format.
- RPTR files cannot be opened in the Crystal Reports designer. They can only be previewed in the Crystal Reports Viewers, or exported to other formats.
Resolution
- Contact the original report designer to get a copy of the RPTR file as RPT.
Keywords
Export ExportToDisk ExportToStream CR.NET CR4VS2010 , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem