|
-
Sep 14th, 2005, 02:02 AM
#1
Thread Starter
Hyperactive Member
Crystal Report Datasource problem
Dear all,
I have created a crystal report at my computer, but as I move the program to another computer, it always pops up an dialog that ask me the server, but I don't want that to happen, can anyone help??
-
Sep 14th, 2005, 03:07 AM
#2
Re: Crystal Report Datasource problem
Hi Playkid
Try this
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 CrystalReport1
crConnectionInfo = New ConnectionInfo
With crConnectionInfo
.ServerName = "YourServer"
.DatabaseName = "YourDB"
.UserID = "YourUsername"
.Password = "HisPassword"
End With
crDatabase = crReportDocument.Database
crTables = crDatabase.Tables
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
formula = "{auxprintcorpoenc.login}='" & Utilizador.Login & "'"
crReportDocument.RecordSelectionFormula = formula
crReportDocument.PrintOptions.PaperOrientation = PaperOrientation.Landscape
CrystalReportViewer1.DisplayGroupTree = False
CrystalReportViewer1.Zoom(100)
CrystalReportViewer1.ReportSource = crReportDocument
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
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
|