Print Page | Close Window

.net preview taking time

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6452
Printed Date: 28 Apr 2024 at 1:27pm


Topic: .net preview taking time
Posted By: Srinivasan
Subject: .net preview taking time
Date Posted: 25 May 2009 at 12:40am
Hello Sir,

I have an issue i.e, I am using crystal report(version 11 release 2) in my windows applications developed in vb.net (2005)and sql server(2005) as backend . In one of the forms i placed one reportviewer control,

crystal report taking long time for preview & print(nearly 2 minute) .
please any one help me to getout of this

Dim rpt As New CrystalReport1() 'The report you created.
        Dim myConnection As SqlConnection
        Dim MyCommand As New SqlCommand()
        Dim myDA As New SqlDataAdapter()
        Dim myDS As New Dataset1() 'The DataSet you created.

        Try

            myConnection = New SqlConnection("Data Source=localhost;Integrated Security=SSPI;" & _
                                             "Initial Catalog=northwind;")
            MyCommand.Connection = myConnection
            MyCommand.CommandText = "SELECT * FROM Customers"
            MyCommand.CommandType = CommandType.Text
            myDA.SelectCommand = MyCommand

            myDA.Fill(myDS, "Customers")
            rpt.SetDataSource(myDS)
            CrystalReportViewer1.ReportSource = rpt

        Catch Excep As Exception
            MessageBox.Show(Excep.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

Advance thnx.

-------------
srini



Print Page | Close Window