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??
Printable View
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??
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