Hey All,
I have reports written in crystal v9 that I am running from web app using vb.net. Whenever I try and export, I get this error message:
Error in File C:\path\file.rpt Operation not yet implemented
If I place a watch on it I see that the value of the report document on the line of code :
oRptExport.export = Run-time exception thrown: System.Not SupportedException - Error in file etc,etc(the rest same as written earlier)
I checked the version of the export dll's being used and they are all v 9.2.1.568 - However when I try to add them to the project I get "A reference to filepath\.dll\ could not be added. This is not a valid assembly or COM componenrt.Only assemblies with extewnsion 'dll' and COM components can be referenced. Please make sure that the file is accessible, and that it is a valid assembly or COM component". I thought the export dll's used were crxf_xls.dll, crxf_wordw.dll, crxf_rtf.dll and crxf_pdf.dll
I thought I could do an export without having to use the RAS (report application server)namespace. This is just an intranet site for internal use. I'm really stuck, have been looking around and find nothing useful. Any suggestions would be appreciated . Thanks in advance!!
The code I am using is:
Private Sub ExportReport()
'
Dim ExportPath As String
ExportPath = Request.PhysicalApplicationPath
crDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
determineReport(Session("ReportName"))
oRptExport.Load(Server.MapPath("") + "\Reports\" + strReportName)
crExportOptions = oRptExport.ExportOptions()
strPrintOption = cboChoice.SelectedItem.Text
Select Case cboChoice.SelectedItem.Text 'this contains the value of the selected export format.
Case "Rich Text (RTF)"
'--------------------------------------------------------------------
'Export to RTF.
'append a filename to the export path and set this file as the filename property for
'the DestinationOptions class
crDiskFileDestinationOptions.DiskFileName = ExportPath + "RichTextFormat1.rtf"
'set the required report ExportOptions properties
With oRptExport.ExportOptions
.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.RichText
.DestinationOptions = crDiskFileDestinationOptions
End With
'--------------------------------------------------------------------
'--------------------------------------------------------------------
Case "Portable Document (PDF)"
'Export to PDF
'append a filename to the export path and set this file as the filename property for
'the DestinationOptions class
crDiskFileDestinationOptions.DiskFileName = ExportPath + "PortableDoc.pdf"
'set the required report ExportOptions properties
With oRptExport.ExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With
'--------------------------------------------------------------------
'--------------------------------------------------------------------
Case "MS Word (DOC)"
'Export to Word
'append a filename to the export path and set this file as the filename property for
'the DestinationOptions class
crDiskFileDestinationOptions.DiskFileName = ExportPath + "Word.doc"
'set the required report ExportOptions properties
With oRptExport.ExportOptions
.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.WordForWindows
.DestinationOptions = crDiskFileDestinationOptions
End With
'--------------------------------------------------------------------
'--------------------------------------------------------------------
Case "MS Excel (XLS)"
'Export to Excel
'append a filename to the export path and set this file as the filename property for
'the DestinationOptions class
crDiskFileDestinationOptions.DiskFileName = ExportPath + "Excel.xls"
'set the required report ExportOptions properties
With oRptExport.ExportOptions
.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.Excel
.DestinationOptions = crDiskFileDestinationOptions
End With
'--------------------------------------------------------------------
End Select 'export format
'Once the export options have been set for the report, the report can be exported. The Export command
'does not take any arguments
Try
blnReport = True
oRptExport.Export()
' create process to launch requested exported file type in corresponding application
createExportProcess()
Catch err As Exception
lblMessage.Text = err.Message.ToString
End Try
End Sub