Crystal Reports question (newbie)

  • Thread starter Thread starter Adriano
  • Start date Start date
A

Adriano

hello,

i created a crystal report, put browser on a form, pointed to report source
then while loading database login information dialog appears,
how can i avoid displaying that dialog???

tnx in advance,
Adriano
 
Hi Adriano
You need to apply the apply the logon information to each
table of your report. You need to modify CrystalReport1
with the name of your report.
Kind Regards
Jorge

Imports System.Data.SqlClient
Imports System.Data
Imports System.ComponentModel
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared

Dim crReportDocument As New
CrystalReports1
crConnectionInfo = New ConnectionInfo
With crConnectionInfo
.ServerName = "YourServer"
.DatabaseName = "YourDatabase"
.UserID = "UserName"
.Password = "UserPass"
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
 
Back
Top