Microsoft
Software
Hardware
Network
Question : Report Document export not working...
Hello All,
I am stumped - I try to export a report document to any format like .pdf, .xls, .doc, .rtf and I consistently get the error:
Error in File C:\..\reportname.rpt: Operation not yet implemented
If I look at the line in debugger, with a watch, the value is:
Run-time exception thrown: System.NotSupportedExcepti
on
The code I'm running looks like:
Dim ExportPath As String
ExportPath = Request.PhysicalApplicatio
nPath
'If Directory.Exists(ExportPat
h) = False Then
' Directory.CreateDirectory(
Request.Ph
ysicalAppl
icationPat
h)
'End If
crDiskFileDestinationOptio
ns = New CrystalDecisions.Shared.Di
skFileDest
inationOpt
ions
determineReport(Session("R
eportName"
))
oRpt.Load(Server.MapPath("
") + "\" + strReportName)
crExportOptions = oRpt.ExportOptions()
strPrintOption = cboChoice.SelectedItem.Tex
t
Select Case cboChoice.SelectedItem.Tex
t '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
crDiskFileDestinationOptio
ns.DiskFil
eName = ExportPath + "RichTextFormat1.rtf"
'set the required report ExportOptions properties
With oRpt.ExportOptions
.ExportDestinationType = CrystalDecisions.Shared.Ex
portDestin
ationType.
DiskFile
.ExportFormatType = CrystalDecisions.Shared.Ex
portFormat
Type.RichT
ext
.DestinationOptions = crDiskFileDestinationOptio
ns
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
crDiskFileDestinationOptio
ns.DiskFil
eName = ExportPath + "PortableDoc.pdf"
'set the required report ExportOptions properties
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptio
ns
.ExportDestinationType = CrystalDecisions.Shared.Ex
portDestin
ationType.
DiskFile
.ExportFormatType = CrystalDecisions.Shared.Ex
portFormat
Type.Porta
bleDocForm
at
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
crDiskFileDestinationOptio
ns.DiskFil
eName = ExportPath + "Word.doc"
'set the required report ExportOptions properties
With oRpt.ExportOptions
.ExportDestinationType = CrystalDecisions.Shared.Ex
portDestin
ationType.
DiskFile
.ExportFormatType = CrystalDecisions.Shared.Ex
portFormat
Type.WordF
orWindows
.DestinationOptions = crDiskFileDestinationOptio
ns
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
crDiskFileDestinationOptio
ns.DiskFil
eName = ExportPath + "Excel.xls"
'set the required report ExportOptions properties
With oRpt.ExportOptions
.ExportDestinationType = CrystalDecisions.Shared.Ex
portDestin
ationType.
DiskFile
.ExportFormatType = CrystalDecisions.Shared.Ex
portFormat
Type.Excel
.DestinationOptions = crDiskFileDestinationOptio
ns
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
oRpt.Export()
' create process to launch requested exported file type in corresponding application
createExportProcess()
Catch err As Exception
If err.Message = "Thread was being aborted." Then
createExportProcess()
Else
lblMessage.Text = err.Message.ToString '+ err.ToString
End If
End Try
I am really stuck, any help appreciated..
Answer : Report Document export not working...
Like you said, that's seem to be an issue with version 9 of CR.
I think that Crystal Decision can help you to resolve it!
Do you know that with crystal report, you got answered by email support!
Go on there web site at this page:
http://support.businessobj
ects.com/s
upport/ans
wers.asp?
r
ef=default
.asp_selec
tlist
Click on next button and follow the instruction...
I hope that can help you!
TwoSide
Random Solutions
Automate import of multiple data files, based on multiple auto-imported file layouts.
Missing ActiveX Control ??
Count of users in AD group
Insert single column into table using select statement
Inventory Allocation and FIFO
ASP.NET Gridview with linkbutton
How to associate a default schema with a login
CertSelectCertificate hook Callback Function does not get called
Anybody have VBA code to force run Macro when open, but also will lock down access to VBA editor without password
Multiple Instances??