pdf exporting... error...

JerBlur

New member
Joined
Jul 21, 2004
Messages
1
Programming Experience
1-3
cyrstal reports export to pdf format.. "logon failed" error...

hey all out there... currently i have this project on hand and im really really stuck... can't seem to figure out where the problem lies in... im trying to export data from crystal reports into pdf file formats... but i keep on getting the same error.. which states "Logon failed"..

i'm using ms access database. connection to database has no errors.. that's y im so stucked...

can anybody out there pls help me out here.. really appreciate all the help i could get now... below is a sample of my codes...

heyz... anyone who had the same problem as me before can u contact me via pm? i really need to find a solution for this urgently... thz... will really really appreciate any help rendered...

Code Sample...
--------------------------------------------------
Do
While (dr2.Read())
For i = 0 To dr2.FieldCount - 1

outputfile = dr2(i).ToString.Replace("-", " ") & ".pdf"

'creating pdf files
doc.SetDataSource(ds)
Dim exportOpts As ExportOptions = doc.ExportOptions
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
Dim diskOpts AsNew DiskFileDestinationOptions
diskOpts.DiskFileName = outputfile
exportOpts.DestinationOptions = diskOpts
doc.Export()

Next i
Loop

dr2.Close()
conn2.Close()
ReturnTrue

Catch sqlex As OleDbException
MessageBox.Show(
"Invalid Database Format or Database Corrupted!", "Database Read Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
ReturnFalse
Catch ex As Exception
MessageBox.Show(ex.Message,
"PDF Creation Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
ReturnFalse
EndTry

EndFunction

 
Last edited:
Back
Top