locked
crystal report 1st time loading is very slow RRS feed

  • Question

  • hi i am using crystal report in win application it taks long time to load when i 1st want to view it taks 2 to 4 mint to load and next time it taks 2 to 3 second to load any one helps me what i am going wrong my preview button coe is
    clsDataBase db = new clsDataBase();
          SqlDataAdapter sdaAdapter = new SqlDataAdapter("SELECT rp.LABID,t.TestName as Test, rp.ParmeterName,CASE rp.Abnormal WHEN 1 then rp.Result + '*' ELSE rp.Result END AS Result, rp.Abnormal, rp.ReferenceRanges,t.PrintROnSepratePage "
                  + " FROM ResultParmeter AS rp INNER JOIN  Test AS t ON rp.TestID = t.TestID"
                  + " WHERE (rp.LABID = "+LASID +") AND (rp.TestID = " + TestID + ")",db.m_clsconnection);
          db.m_scoMainConnection.Open(); // Open connection.
          sdaAdapter.Fill(ds, "ResultParmeter");
    
          if (ds.Tables["ResultParmeter"].Rows.Count > 0)
          {
            CReport rcp = new CReport();
            rcp.SetDataSource(ds);
            //rcp.Refresh();
            System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument();
            rcp.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName;
            crystalReportViewer1.ReportSource = rcp;
            //hideTheTabControl();
            this.ShowDialog();
            //crystalReportViewer1.Refresh();
            //crystalReportViewer1.PrintReport();
          }
    
    Friday, July 15, 2011 10:24 AM

Answers

All replies