Solved

Report Document export not working...

Posted on 2004-03-22
6
1,441 Views
Last Modified: 2012-06-21
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.NotSupportedException

The code I'm running looks like:



Dim ExportPath As String

        ExportPath = Request.PhysicalApplicationPath

        'If Directory.Exists(ExportPath) = False Then
        '    Directory.CreateDirectory(Request.PhysicalApplicationPath)
        'End If

        crDiskFileDestinationOptions = New CrystalDecisions.Shared.DiskFileDestinationOptions
        determineReport(Session("ReportName"))
        oRpt.Load(Server.MapPath("") + "\" + strReportName)
        crExportOptions = oRpt.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 oRpt.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 crExportOptions
                    .DestinationOptions = crDiskFileDestinationOptions
                    .ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
                    .ExportFormatType = CrystalDecisions.Shared.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 oRpt.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 oRpt.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

            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..
0
Comment
Question by:Mosquitoe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 3

Expert Comment

by:TwoSide
ID: 10652155
I don't know if that can help you but....

here is the code I'v use yesterday to export a report to a pdf format

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

'//--- Your code...

'//--- Take note that the report data source have been initialise before the call of this function!
Private Sub ExportToPDF(ByVal rpt As rptReception, ByVal sFileName As String)
        Try
            Dim crReportDocument As ReportDocument
            Dim crExportOptions As ExportOptions
            Dim crDiskFileDestinationOptions As DiskFileDestinationOptions

            crReportDocument = rpt

            crDiskFileDestinationOptions = New DiskFileDestinationOptions

            crDiskFileDestinationOptions.DiskFileName = Environment.GetEnvironmentVariable("TEMP") & "\" & sFileName

            crExportOptions = crReportDocument.ExportOptions
            With crExportOptions
                .DestinationOptions = crDiskFileDestinationOptions
                .ExportDestinationType = ExportDestinationType.DiskFile
                .ExportFormatType = ExportFormatType.PortableDocFormat
            End With

            crReportDocument.Export()
        Catch oEx As System.Exception
            MessageBox.Show(oEx.Message)
        End Try
    End Sub

TwoSide
0
 

Author Comment

by:Mosquitoe
ID: 10652226

Thanks for you reply - Your code looks a lot like what I have tried to do.  My database connection is taken care of at the report level, I do not have to programmically re-connect.  I can view the report in the browser but when I attempt to export it to another file format, this is where I get the : Error in File c\...  Operation not yet implemented.  To me it looks like there is some type of issue with the cr9 report - but I can't figure out what??  This was working last week with cr v8.5..?
0
 

Author Comment

by:Mosquitoe
ID: 10657446
..still hoping somebody has an idea of how I can solve this... :(
0
 
LVL 3

Accepted Solution

by:
TwoSide earned 500 total points
ID: 10657543
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.businessobjects.com/support/answers.asp?ref=default.asp_selectlist
Click on next button and follow the instruction...

I hope that can help you!
TwoSide
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question