Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 2nd, 2003, 11:55 AM
Registered User
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Crystal export to pdf

I have a crystal report that I'm attempting to export to pdf programmatically from vb.net. I get the following error message at the 'rpt.export' line:

An unhandled exception of type 'CrystalDecisions.CrystalReports.Engine.LogOnExcep tion' occurred in crystaldecisions.crystalreports.engine.dll

Additional information: Error in File C:\DOCUME~1\RBOHLA~1.BHS\LOCALS~1\Temp\temp_ef3b28 56-3c2c-4602-af2b-66721660df17.rpt:
Unable to connect: incorrect log on parameters.

The crystal report is already displayed in the crviewer when I try to export via a button, so I've already passed by db credentials. Has anyone else seen this?

Old November 18th, 2004, 09:16 PM
Registered User
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to harland

I have the same problem.. I tried giving access to aspnet account but still it didn't work.. but when I reboot my pc it work for a while.. After 4-5 tries the error reappeared again..

Old November 20th, 2004, 02:09 AM
Registered User
Join Date: Nov 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ayyanarj Send a message via Yahoo to ayyanarj

To avoid the above problem in asp.net....

Use the Follwing.......

cp means Crystal report(.rpt file)

 Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
        Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo

        For Each myTable In cp.Database.Tables
            myLogin = myTable.LogOnInfo
            myLogin.ConnectionInfo.Password = "gis"
            myLogin.ConnectionInfo.UserID = "gis"

Old November 22nd, 2004, 04:10 AM
Registered User
Join Date: Nov 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to harland

wow!... thanks a lot.. it really works!!

Old January 28th, 2005, 01:17 PM
Registered User
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to cwaletzko Send a message via Yahoo to cwaletzko

Does anyone have a similar fix for VB.net and exporting a crystal report to a MS Word document?

Old February 3rd, 2005, 04:35 PM
Registered User
Join Date: Feb 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I have the same problem as so many people seem to have and cannot solve it. I checked read/write permissions on my export folder. I even manually send logoninformation to the table I want to use as datasource for the report. I still don't get it.
I use the push model. Have a dataset called dataset1.xsd and crystalreport1.rpt. right mouse click on report: verify datasource works. So reports datasource is synchronized with dataset.

Here is my code:

Dim myConnection As New OleDb.OleDbConnection
        myConnection.ConnectionString = "provider=SQLOLEDB;data source=***;initial catalog=***;user id=***;password=***"
Dim MyCommand As New OleDb.OleDbCommand
MyCommand.Connection = myConnection
MyCommand.CommandText = "Select * From reporte_orden " & Filtro & " "
MyCommand.CommandType = CommandType.Text
Dim MyDA As New OleDb.OleDbDataAdapter
MyDA.SelectCommand = MyCommand
Dim DataSet4Report As New Dataset1
MyDA.Fill(DataSet4Report, "reporte_orden")

Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions

crReportDocument = New CrystalReport1

        Dim Logoninfo As TableLogOnInfo = New TableLogOnInfo
        Dim Conninfo As ConnectionInfo = New ConnectionInfo
        Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
        Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
        Dim crTable As CrystalDecisions.CrystalReports.Engine.Table
        Conninfo.ServerName = "***"
        Conninfo.DatabaseName = "***"
        Conninfo.UserID = "***"
        Conninfo.Password = "***"
        crDatabase = crReportDocument.Database
        crTables = crDatabase.Tables
        crTable = crDatabase.Tables("reporte_orden")
        Logoninfo = crTable.LogOnInfo
        Logoninfo.ConnectionInfo = Conninfo

        crReportDocument.Load("d:\inetpub\wwwroot\260105\C rystalReport1.rpt")

        crDiskFileDestinationOptions = New DiskFileDestinationOptions
        crDiskFileDestinationOptions.DiskFileName = "d:\exports\" & Session.SessionID.ToString & ".pdf"
        crExportOptions = crReportDocument.ExportOptions
        With crExportOptions
            .DestinationOptions = crDiskFileDestinationOptions
            .ExportDestinationType = ExportDestinationType.DiskFile
            .ExportFormatType = ExportFormatType.PortableDocFormat
        End With


Would be grateful for some help.

Old August 25th, 2008, 02:38 AM
Posts: n/a

Exporting Crystal report ot PDF file use this code.

            CrDiskFileDestinationOptions.DiskFileName = _
            CrExportOptions = cryRpt.ExportOptions
            With CrExportOptions


hu yang.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Crystal Report to PDF aarunlal ASP.NET 2.0 Professional 1 June 28th, 2006 01:18 PM
Export to PDF problem with crystal report in c# fidelio ASP.NET 1.0 and 1.1 Professional 0 April 12th, 2006 07:34 AM
Crystal Report 8.5 Export to PDF problem DragonSon Crystal Reports 0 August 17th, 2004 10:32 PM
Crystal 9 PDF export problem AlexB Crystal Reports 0 January 7th, 2004 04:07 PM
Pdf Crystal Report export Kristoff Crystal Reports 1 October 21st, 2003 09:38 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.