Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 2nd, 2003, 11:55 AM
Registered User
 
Join Date: Aug 2003
Location: Baton Rouge, LA, USA.
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?

Reply With Quote
  #2 (permalink)  
Old November 18th, 2004, 09:16 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to harland
Default

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..

Reply With Quote
  #3 (permalink)  
Old November 20th, 2004, 02:09 AM
Registered User
 
Join Date: Nov 2004
Location: Pondicherry, Pondicherry, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ayyanarj Send a message via Yahoo to ayyanarj
Default

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
       cp.load()

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

Ayyanar.J
Reply With Quote
  #4 (permalink)  
Old November 22nd, 2004, 04:10 AM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to harland
Default

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

Reply With Quote
  #5 (permalink)  
Old January 28th, 2005, 01:17 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to cwaletzko Send a message via Yahoo to cwaletzko
Default

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

Reply With Quote
  #6 (permalink)  
Old February 3rd, 2005, 04:35 PM
Registered User
 
Join Date: Feb 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
        crTable.ApplyLogOnInfo(Logoninfo)

        crReportDocument.SetDataSource(DataSet4Report)
        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

        crReportDocument.Export()

Would be grateful for some help.

Reply With Quote
  #7 (permalink)  
Old August 25th, 2008, 02:38 AM
hu_yang
Guest
 
Posts: n/a
Default

Exporting Crystal report ot PDF file use this code.

            CrDiskFileDestinationOptions.DiskFileName = _
                                        "c:\crystalExport.pdf"
            CrExportOptions = cryRpt.ExportOptions
            With CrExportOptions

http://vb.net-informations.com/cryst...export_pdf.htm

hu yang.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:26 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.