コード例 #1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     lock (thisLock)
     {
         try
         {
             DBServer db = new DBServer();
             DataSet  ds = new DataSet();
             DateTime dt = Convert.ToDateTime(txt_from_date.Value);
             db.fromdate = txt_from_date.Value;
             db.todate   = txt_to_date.Value;
             ds          = db.ViewAllEfficiencyCalbydatetime(db);
             if (ds.Tables[0].Rows.Count > 0)
             {
                 LocalReport lr  = null;
                 DataSet     ds1 = new DataSet();
                 ReportViewer1.ProcessingMode = ProcessingMode.Local;
                 lr            = ReportViewer1.LocalReport;
                 lr.ReportPath = "Reports/Report5.rdlc";
                 ReportDataSource rds = new ReportDataSource("DataSet1_ViewAllEfficiencyCal", ds.Tables[0]);
                 ReportViewer1.LocalReport.DataSources.Clear();
                 ReportViewer1.LocalReport.DataSources.Add(rds);
                 ReportViewer1.LocalReport.Refresh();
             }
             else
             {
                 //  ReportViewer1.LocalReport.DataSources.Clear();
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record Not Found');", true);
             }
         }
         catch (Exception ex)
         {
             ExceptionLogging.SendExcepToDB(ex);
         }
         finally
         {
         }
     }
 }