示例#1
0
    //public void get_Reports()
    //{
    //    ds = objserver.GetDateset("select * from EfficiencyReports");
    //    ReportDataSource rds = new ReportDataSource("DataSet1_EfficiencyReports", ds.Tables[0]);
    //    if (ds.Tables[0].Rows.Count > 0)
    //    {
    //        LocalReport lr = null;
    //        DataSet ds1 = new DataSet();
    //        ReportViewer1.ProcessingMode = ProcessingMode.Local;
    //        lr = ReportViewer1.LocalReport;
    //        lr.ReportPath = "Reports/Efficiency.rdlc";

    //        ReportViewer1.LocalReport.DataSources.Clear();
    //        ReportViewer1.LocalReport.DataSources.Add(rds);
    //        ReportViewer1.LocalReport.Refresh();

    //    }
    //    else
    //    {
    //        LocalReport lr = null;
    //        lr = ReportViewer1.LocalReport;
    //        lr.ReportPath = "Reports/Efficiency.rdlc";
    //        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record Not Found');", true);
    //        ReportViewer1.LocalReport.DataSources.Clear();
    //        ReportViewer1.LocalReport.DataSources.Add(rds);
    //        ReportViewer1.LocalReport.Refresh();
    //    }
    //}
    //public void Showdatewise()
    //{
    //    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.ViewAllEfficiencyReportsdatetime(db);
    //    ReportDataSource rds = new ReportDataSource("DataSet1_EfficiencyReports", ds.Tables[0]);
    //    if (ds.Tables[0].Rows.Count > 0)
    //    {
    //        LocalReport lr = null;
    //        DataSet ds1 = new DataSet();
    //        ReportViewer1.ProcessingMode = ProcessingMode.Local;
    //        lr = ReportViewer1.LocalReport;
    //        lr.ReportPath = "Reports/Efficiency.rdlc";

    //        ReportViewer1.LocalReport.DataSources.Clear();
    //        ReportViewer1.LocalReport.DataSources.Add(rds);
    //        ReportViewer1.LocalReport.Refresh();
    //    }
    //    else
    //    {
    //        LocalReport lr = null;
    //        lr = ReportViewer1.LocalReport;
    //        lr.ReportPath = "Reports/Efficiency.rdlc";
    //        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record Not Found');", true);
    //        ReportViewer1.LocalReport.DataSources.Clear();
    //        ReportViewer1.LocalReport.DataSources.Add(rds);
    //        ReportViewer1.LocalReport.Refresh();
    //    }
    //}
    ////protected void btn_datewise_Click(object sender, EventArgs e)
    ////{
    ////    Showdatewise();
    ////}
    ////protected void btn_viewall_Click(object sender, EventArgs e)
    ////{
    ////    get_Reports();
    ////}
    //protected void img_results_Click(object sender, ImageClickEventArgs e)
    //{
    //    DBServer db = new DBServer();
    //    DataSet ds = new DataSet();
    //    ds = db.ViewAllEfficiency(ddl_partno.Value.ToString(), ddl_operation.Value.ToString(), txt_from_date.Value.ToString(), txt_to_date.Value.ToString());
    //    ReportDataSource rds = new ReportDataSource("DataSet1_EfficiencyReports", ds.Tables[0]);
    //    if (ds.Tables[0].Rows.Count > 0)
    //    {
    //        LocalReport lr = null;
    //        DataSet ds1 = new DataSet();
    //        ReportViewer1.ProcessingMode = ProcessingMode.Local;
    //        lr = ReportViewer1.LocalReport;
    //        lr.ReportPath = "Reports/Efficiency.rdlc";

    //        ReportViewer1.LocalReport.DataSources.Clear();
    //        ReportViewer1.LocalReport.DataSources.Add(rds);
    //        ReportViewer1.LocalReport.Refresh();
    //    }
    //    else
    //    {
    //        LocalReport lr = null;
    //        lr = ReportViewer1.LocalReport;
    //        lr.ReportPath = "Reports/Efficiency.rdlc";
    //        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record Not Found');", true);
    //        ReportViewer1.LocalReport.DataSources.Clear();
    //        ReportViewer1.LocalReport.DataSources.Add(rds);
    //        ReportViewer1.LocalReport.Refresh();
    //    }
    //}

    protected void img_view_Click(object sender, ImageClickEventArgs e)
    {
        string partno, operation, type, fromdate, todate, shift;

        partno    = ddl_partno.Value.ToString();
        operation = ddl_operation.Value.ToString();
        type      = ddl_type.Value.ToString();
        fromdate  = txt_fromdate.Value.ToString();
        todate    = txt_todate.Value.ToString();
        shift     = ddl_shift.Value.ToString();
        lock (thisLock)
        {
            try
            {
                if (type == "1")
                {
                    Response.Redirect("DMTRptFrm.aspx?Type=" + type + "&Partno=" + partno + "&Operation=" + operation + "&fromdate=" + fromdate + "&todate=" + todate + "&Shift=" + shift);
                }
                if (type == "2")
                {
                    DBServer db = new DBServer();
                    DataSet  ds = new DataSet();
                    ds = db.viewpageloadresulteffiency(partno, operation, fromdate, todate, shift);
                    ReportDataSource rds = new ReportDataSource("DataSet1_EfficiencyReports", ds.Tables[0]);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        LocalReport lr  = null;
                        DataSet     ds1 = new DataSet();
                        ReportViewer1.ProcessingMode = ProcessingMode.Local;
                        lr            = ReportViewer1.LocalReport;
                        lr.ReportPath = "Reports/Efficiency.rdlc";

                        ReportViewer1.LocalReport.DataSources.Clear();
                        ReportViewer1.LocalReport.DataSources.Add(rds);
                        ReportViewer1.LocalReport.Refresh();
                    }
                    else
                    {
                        LocalReport lr = null;
                        lr            = ReportViewer1.LocalReport;
                        lr.ReportPath = "Reports/Efficiency.rdlc";
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record Not Found');", true);
                        ReportViewer1.LocalReport.DataSources.Clear();
                        ReportViewer1.LocalReport.DataSources.Add(rds);
                        ReportViewer1.LocalReport.Refresh();
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLogging.SendExcepToDB(ex);
            }
            if (type == "3")
            {
                Response.Redirect("~/QualityGrid/ViewQChart.aspx?Type=" + type + "&Partno=" + partno + "&Operation=" + operation + "&fromdate=" + fromdate + "&todate=" + todate + "&Shift=" + shift);
            }
        }
    }
示例#2
0
    public void showpageloadresult(string partno, string operation, string fromdate, string todate, string shift)
    {
        lock (thisLock)
        {
            try
            {
                DBServer db = new DBServer();
                DataSet  ds = new DataSet();
                ds = db.viewpageloadresulteffiency(partno, operation, fromdate, todate, shift);
                ReportDataSource rds = new ReportDataSource("DataSet1_EfficiencyReports", ds.Tables[0]);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    LocalReport lr  = null;
                    DataSet     ds1 = new DataSet();
                    ReportViewer1.ProcessingMode = ProcessingMode.Local;
                    lr            = ReportViewer1.LocalReport;
                    lr.ReportPath = "Reports/Efficiency.rdlc";

                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(rds);
                    ReportViewer1.LocalReport.Refresh();
                }
                else
                {
                    LocalReport lr = null;
                    lr            = ReportViewer1.LocalReport;
                    lr.ReportPath = "Reports/Efficiency.rdlc";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Record Not Found');", true);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(rds);
                    ReportViewer1.LocalReport.Refresh();
                }
            }
            catch (Exception ex)
            {
                ExceptionLogging.SendExcepToDB(ex);
            }
        }
    }