G
Guest
I need some help please!
Crystal is driving me nuts.
Heres my code so far, see below.
Problem:
On the .export() line it comes back with error #5 Login failed!
I know the login info is good so why is the bloody thing doing this.
The paths have been checked and are correct.
The crystal Report is a .rpt file. Not one created in the VS.net IDE but in
crystal itself.
It runs fine. It is a SELECT statement against the DB.
I am stuck. Help me get moving again.
<code>
dim str strOrderId as string
strOrderId = "1234"
Dim cryRptDestinationOptions As New
CrystalDecisions.Shared.DiskFileDestinationOptions
With cryRptDestinationOptions
.DiskFileName = (Server.MapPath("./OCCOrderDetailPDFs/" & strOrderId &
".pdf"))
End With
Dim cryRptTheReport As New
CrystalDecisions.CrystalReports.Engine.ReportDocument
With cryRptTheReport
.Load(Server.MapPath("./Reports/FI0002-OccBillDetails.rpt"),
CrystalDecisions.[Shared].OpenReportMethod.OpenReportByDefault)
Dim cryRtpLogintableInfo As New CrystalDecisions.Shared.TableLogOnInfo
Dim MyConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
With MyConnectionInfo
.ServerName = "Modor"
.DatabaseName = "MountDoom"
.UserID = "Nazgul"
.Password = "OneRing"
End With
Dim T As CrystalDecisions.CrystalReports.Engine.Table
For Each T In .Database.Tables
cryRtpLogintableInfo = T.LogOnInfo
cryRtpLogintableInfo.ConnectionInfo = MyConnectionInfo
T.ApplyLogOnInfo(cryRtpLogintableInfo)
Next
.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
.ExportOptions.ExportFormatType =
CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
.ExportOptions.DestinationOptions = cryRptDestinationOptions
.Export()
End With
</code>
Crystal is driving me nuts.
Heres my code so far, see below.
Problem:
On the .export() line it comes back with error #5 Login failed!
I know the login info is good so why is the bloody thing doing this.
The paths have been checked and are correct.
The crystal Report is a .rpt file. Not one created in the VS.net IDE but in
crystal itself.
It runs fine. It is a SELECT statement against the DB.
I am stuck. Help me get moving again.
<code>
dim str strOrderId as string
strOrderId = "1234"
Dim cryRptDestinationOptions As New
CrystalDecisions.Shared.DiskFileDestinationOptions
With cryRptDestinationOptions
.DiskFileName = (Server.MapPath("./OCCOrderDetailPDFs/" & strOrderId &
".pdf"))
End With
Dim cryRptTheReport As New
CrystalDecisions.CrystalReports.Engine.ReportDocument
With cryRptTheReport
.Load(Server.MapPath("./Reports/FI0002-OccBillDetails.rpt"),
CrystalDecisions.[Shared].OpenReportMethod.OpenReportByDefault)
Dim cryRtpLogintableInfo As New CrystalDecisions.Shared.TableLogOnInfo
Dim MyConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
With MyConnectionInfo
.ServerName = "Modor"
.DatabaseName = "MountDoom"
.UserID = "Nazgul"
.Password = "OneRing"
End With
Dim T As CrystalDecisions.CrystalReports.Engine.Table
For Each T In .Database.Tables
cryRtpLogintableInfo = T.LogOnInfo
cryRtpLogintableInfo.ConnectionInfo = MyConnectionInfo
T.ApplyLogOnInfo(cryRtpLogintableInfo)
Next
.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
.ExportOptions.ExportFormatType =
CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
.ExportOptions.DestinationOptions = cryRptDestinationOptions
.Export()
End With
</code>