Logon failed... exporting crystal reports into pdf
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...
the destination file path is taken via user's selection thru a folderbrowserdialog... have done all the checkings... the destination path and file names are all correct.. data has been properly extracted from an Access database... but the "logon failed" error still persists...
Code Sample...
--------------------------------------------------
DoWhile (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
|