Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. crystal report taking long time for preview

crystal report taking long time for preview

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpannouncementcsharpdatabase
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    srinisiv
    wrote on last edited by
    #1

    Hello everyone , 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.

    I 1 Reply Last reply
    0
    • S srinisiv

      Hello everyone , 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.

      I Offline
      I Offline
      ISoftwareDev
      wrote on last edited by
      #2

      You're selecting everything from the customers table to add to the report. Is this where the bottleneck is? Do you need to select all of this data?

      S 1 Reply Last reply
      0
      • I ISoftwareDev

        You're selecting everything from the customers table to add to the report. Is this where the bottleneck is? Do you need to select all of this data?

        S Offline
        S Offline
        srinisiv
        wrote on last edited by
        #3

        thnx for Ur replay. I am taking one record only using where condition,but that time also this report taking more time for first preview,next preview its taking less time compare to first preview.

        P D 2 Replies Last reply
        0
        • S srinisiv

          thnx for Ur replay. I am taking one record only using where condition,but that time also this report taking more time for first preview,next preview its taking less time compare to first preview.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          If your database connection has not been pooled, then the first preview will take a lot longer than the second time where it's pulled from the pool.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          1 Reply Last reply
          0
          • S srinisiv

            thnx for Ur replay. I am taking one record only using where condition,but that time also this report taking more time for first preview,next preview its taking less time compare to first preview.

            D Offline
            D Offline
            David Mujica
            wrote on last edited by
            #5

            Is the column you are referencing in your where clause defined by an index ? Use the "show execution plan" option in query analyzer to make sure the query is not doing table scans. Optimize the query first, then the report should work fine.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups