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

If I don't include a change to the formula in my code below,
i.e, instead of this
oRpt.RecordSelectionFormula = oRpt.RecordSelectionFormula + "' and
{RECORDS.CONSTITUENT_ID}= '" & "'" & sConstitID & "'" 'existing formula +

if I do this :
oRpt.RecordSelectionFormula = oRpt.RecordSelectionFormula

the code works, but if I include the change to the formula I get the logon
failed error.  I have two different reports, one works and the other does
not.  I do not see what the difference is between the two.  I believe there
must be some difference, but I can't see it.  HELP!!!!!!!!

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

' 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


'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"


'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 +

On Error GoTo Errcode


If gRptErr = "" Then


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

Wed, 31 Aug 2005 08:25:26 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Help-"Error5-Logon Failed"-HELP PLease!!!!!!-Crystal Report

2. Logon Failed.. Crystal Reports.Net Error (Code Included)

3. Logon Failed when exportign crystal report to PDF (or any other format)

4. Logon Failed For Crystal Reports

5. Crystal Report in .NET - Logon Failed Error while Exporting

6. Logon failed. Crystal Reports .NET

7. NEED HELP DESPERATELY - Application Install Wizard fails...miserably and repeatedly :(

8. Crystal Reports Canned Code

9. Printing of Reports with VB, i need some help desperately

10. I desperately need help with reporting.....

11. FYI - Logon Failed in Crystal.Net having Subreports (Working Code Supplied)

12. Crystal and .NET: Logon failed


Powered by phpBB® Forum Software