Help-"Error5-Logon Failed"-HELP PLease!!!!!!-Crystal Report 
Author Message
 Help-"Error5-Logon Failed"-HELP PLease!!!!!!-Crystal Report

Here I go again.  If you know where I can post this and get some help, let
me know.

The code below works for one report, but for another report I get an Error
5 - Logon Failed

Private Sub CreateReport(ByVal sReport, ByVal sPDF, ByVal sConstitID, ByVal
sRptType)

' passes report location i.e c:\inetpub\wwwroot\report.rpt

' report custom formula i.e {Table.Field1}>1200

' displays report in browser (temp.pdf)

Dim exportOpts As New ExportOptions()

Dim oRpt As New ReportDocument()

Dim conTest As Boolean

Dim diskOpts As New DiskFileDestinationOptions()

Dim strFormula As String

'load report

oRpt.Load(sReport)

'log on to SQL server

Dim crLogonInfo As CrystalDecisions.Shared.TableLogOnInfo

crLogonInfo = oRpt.Database.Tables(0).LogOnInfo

crLogonInfo.ConnectionInfo.ServerName = "server"

crLogonInfo.ConnectionInfo.DatabaseName = "Db"

crLogonInfo.ConnectionInfo.UserID = "ODBCname"

crLogonInfo.ConnectionInfo.Password = "pswd"

oRpt.Database.Tables(0).ApplyLogOnInfo(crLogonInfo)

'export report to viewer PDF

exportOpts = oRpt.ExportOptions

exportOpts.ExportDestinationType = ExportDestinationType.DiskFile

exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat '
ExportFormatType.WordForWindows, ExportFormatType.Excel other formats

'temp file name

diskOpts.DiskFileName = sPDF

exportOpts.DestinationOptions = diskOpts

oRpt.RecordSelectionFormula = oRpt.RecordSelectionFormula + "' and
{RECORDS.CONSTITUENT_ID}= '" & "'" & sConstitID & "'" 'existing formula +
custom

On Error GoTo Errcode

oRpt.Export()

If gRptErr = "" Then

oRpt.Close()

End If

End Sub

After my oRpt.export statement the problem errors with the Error 5.  If I
change this statement to

oRpt.RecordSelectionFormula = oRpt.RecordSelectionFormula

and I don't include the formula that I'm trying to append the report works
as well.

I don't understand why this is, I use the very same code with  another
report.  They are very similar.  It should work.

Any ideas or ideas about who I can ask.

Please help me. I have to get this done today.

Thank you,

Wilson Bell



Tue, 30 Aug 2005 04:56:28 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. HELP PLEASE "Error5-Logon Failed"-Crystal Report-HELP!!!!!

2. Crystal Reports "Load report failed"

3. Desperately Need HELP!!!!-Crystal Report-Logon Fail - Can anyone even give me a lead

4. Report deployment, runtime, "load report failed"

5. GetObject("","InternetExplorer.Application") fails in Excel VBA

6. GetObject("","InternetExplorer.Application") fails in Excel VBA

7. Need help, if possible: "SQLSetConnectAttr failed"

8. HELP: Custom Menubar/"Action Failed" msg

9. item.cc "The operation failed" - Help

10. reports("template").report.recordsource HELP

11. HELP: "VBAJET32.DLL Failed to initialize..."

12. Crystal Reports "Cannot Find Report."

 

 
Powered by phpBB® Forum Software