|
-
Jul 20th, 2007, 11:12 AM
#1
Thread Starter
Hyperactive Member
VB 2005 and Cystal reports
Hi, im making a crystal report for my program and after setting it up and running it, it then asks me to login to the database where it is getting the data from, what codes should i add in order to skip this login prompt everytime i run the crystal report / form? thanks im using 05.
-
Jul 23rd, 2007, 08:15 AM
#2
Re: VB 2005 and Cystal reports
Hi.
Here's how to avoid login information prompt
vb Code:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo
Dim crReportDocument As New CrystalReports1
crConnectionInfo = New ConnectionInfo
With crConnectionInfo
.ServerName = "Ares"
.DatabaseName = "Dinefer"
.UserID = "bb"
.Password = "aa"
End With
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
crReportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape
crReportDocument.PrintOptions.PaperSize = PaperSize.PaperA4
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.Zoom(100)
CrystalReportViewer1.ReportSource = crReportDocument
"The dark side clouds everything. Impossible to see the future is."
-
Jul 23rd, 2007, 08:15 AM
#3
Re: VB 2005 and Cystal reports
Read crystal report tutorial at my signature!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|