Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Loading Crystal Report in vb.net is slow

gopakumargopakumar Member Posts: 4
Hi,
I m working with vb.net 2005 and crystal report 10 .the time to load crystal report is very high.it takes a minute to load a simple report.
the code i used given below.
if anyone know to solve this problem, please give me reply.

Dim repDoc As New ReportDocument
Dim subRepDoc As New ReportDocument
Dim crSections As Sections
Dim crSection As Section
Dim crReportObjects As ReportObjects
Dim crReportObject As ReportObject
Dim crSubreportObject As SubreportObject
Dim crDatabase As Database
Dim crTables As Tables
Dim crTable As Table
Dim crLogOnInfo As TableLogOnInfo
Dim crConnInfo As New ConnectionInfo
repDoc.Load(CrystalStrReport) 'Report path
crDatabase = repDoc.Database
crTables = crDatabase.Tables
For Each crTable In crTables
With crConnInfo
.ServerName = "Server"
.DatabaseName = "Sample"
.UserID = "sa"
.Password = "abcd"
End With
crLogOnInfo = crTable.LogOnInfo
crLogOnInfo.ConnectionInfo = crConnInfo
crTable.ApplyLogOnInfo(crLogOnInfo)
Next
crTable.Location = "Sample" & ".dbo." & crTable.Location.Substring(crTable.Location.LastIndexOf(".") + 1)
crSections = repDoc.ReportDefinition.Sections
CrystalReportViewer1.ReportSource = repDoc
CrystalReportViewer1.Show()



Gopakumar

Sign In or Register to comment.