Crystal Reports Export Fails

Dear Experts,
When I'm trying to export a Crystal report, it is failing with an Error Database Logon Failed.  Please find the code attached.

Please let me know if Im missing something..

Thanks
Siva
Dim strconn = "Data Source=MUNINSERT2;User ID=isqlprd;Password=sysinsert;Initial Catalog=insertsystem"
        Dim sqlconn As New SqlConnection(strconn)
        sqlconn.Open()
        Dim ds As New DataSet()
        Dim param As SqlParameter
        Dim cmdDisclaimer As New SqlCommand("WorkOrderDisclaimersMedlineXML", sqlconn)
        cmdDisclaimer.Connection = sqlconn
        cmdDisclaimer.CommandType = CommandType.StoredProcedure
        param = cmdDisclaimer.Parameters.Add(New SqlParameter("@WorkOrderID", System.Data.SqlDbType.VarChar, 10))
        param.Direction = System.Data.ParameterDirection.Input
        param.Value = "6665470"
        Dim daMedline As New SqlDataAdapter(cmdDisclaimer)
        daMedline.SelectCommand = cmdDisclaimer

        daMedline.Fill(dsMedlineDisclaimer, "dtMedlineDisclaimerDetails")
        'daMedline.Fill(ds)
        'Close connection
        sqlconn.Close()
        Try
            Dim CR As New ReportDocument

            CR.Load("C:\WindowsApplication2\WindowsApplication2\Insert8x11.rpt")
            CR.SetDatabaseLogon("isqlprd", "sysinsert", "MUNINSERT2", "insertsystem")
            CR.SetDataSource(dsMedlineDisclaimer.Tables(0))

            'CR.SetDataSource(ds)
            'Dim ExportOptions As New CrystalDecisions.Shared.ExportOptions()
            'Dim DiskFileDestinationOptions As CrystalDecisions.Shared.DiskFileDestinationOptions
            'DiskFileDestinationOptions = CrystalDecisions.Shared.ExportOptions.CreateDiskFileDestinationOptions()
            'ExportOptions.ExportFormatType = ExportFormatType.CrystalReport
            'ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
            'DiskFileDestinationOptions.DiskFileName = "\\muninsert2\EDrive\SPT\InsertSystem\PrintQueue\CrystalReport1.rpt"
            'ExportOptions.ExportDestinationOptions = DiskFileDestinationOptions
            'CR.Export(ExportOptions)

            CR.ExportToDisk(ExportFormatType.PortableDocFormat, "\\muninsert3\EDrive\SPT\InsertSystem\PrintQueue\Insert8x11.rpt")
            CrystalReportViewer1.ReportSource = CR
            CrystalReportViewer1.Show()

        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

Open in new window

sivamanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
Are there any subreports?
0
sivamanAuthor Commented:
No, there are no subreports. The report which Im loading is a report which is migrated from CR 4.0 to CR 2008.
0
sivamanAuthor Commented:
Please find attached the screen shot of the Error message .  Crystal-Reports-Export-Error.docx
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

mlmccCommented:
Do you have more than 1 table in the report?
If so sometimes you have to loop through the tables and apply the logon information

mlmcc
0
sivamanAuthor Commented:
I'm able to export the reports. The report data source wasnt pointing to the right source.

Thanks
Siva
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mlmccCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.