Crystal Report Help Please or Tell me where to get Crystal Help 
Author Message
 Crystal Report Help Please or Tell me where to get Crystal Help

I posted this last friday and no one responded.

I have to get this to work today.  Please.

I am using the code below and it works with one of my reports, but another
one that is very similar is not working. It gives me an
Error5 - Logon Failed after the oRpt.Export is performed

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 = "RE7"

crLogonInfo.ConnectionInfo.DatabaseName = "D"

crLogonInfo.ConnectionInfo.UserID = "REDBC"

crLogonInfo.ConnectionInfo.Password = "reodbc"

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

When I change my code to this line (just before the export)

oRpt.RecordSelectionFormula = oRpt.RecordSelectionFormula

and I don't add the formula that I need to, the report works, but I don't
get the results that I want obviously because the criteria that I want is
not specified.

Please Help me or give me direction on where I can post.

Thanks very much.

Wilson Bell



Sun, 28 Aug 2005 04:14:33 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Please Please help !!! Crystal Report Help Needed

2. Please Help...Crystal Reports..Please Help

3. Please Help Newbie Crystal Report / VB help needed.

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

5. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

6. Printing Crystal Reports without Crystal Control ActiveX or Crystal Reports API call

7. Help: Getting query info into Crystal Report

8. Good Reporting Tool for VB to SQL (Currently Use Crystal) or Crystal w/SQL Help Appreciated

9. Help Help Help with Crystal report

10. Crystal Report Error-Please Help

11. Please help me with crystal report ...

12. HELP ME WITH CRYSTAL REPORT PRO PLEASE...

 

 
Powered by phpBB® Forum Software