?
Solved

Report Document export not working...

Posted on 2004-03-22
6
Medium Priority
?
1,455 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 2000 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

762 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