Exemplo n.º 1
0
    protected void btnExport_Click(object sender, EventArgs e)
    {
        ToolUtility tu = new ToolUtility();

        if (gvResult.HeaderRow != null && gvResult.HeaderRow.Cells.Count > 0)
            tu.ExportExcel(gvResult, "CT_TAT", Page);
        else
        {
            string str = "   alert( 'Please select one record! ' );";
            string script = "<script type='text/javascript' language='javascript'>" + str + "</script>";
            ClientScript.RegisterStartupScript(GetType(), "", script);

        }
    }
Exemplo n.º 2
0
 protected void btnDetailExport_Click(object sender, EventArgs e) {
     ToolUtility tu = new ToolUtility();
     if (gvStationDetail.HeaderRow != null && gvStationDetail.HeaderRow.Cells.Count > 0)
         tu.ExportExcel(gvStationDetail, "PCBInputDetailQuery", Page);
     else
         writeToAlertMessage("Please select one record!");        
 }
Exemplo n.º 3
0
 protected void btnDetailExport_Click(object sender, EventArgs e)
 {
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(grvDetail, Page.Title, Page);
 }
Exemplo n.º 4
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     ToolUtility tu = new ToolUtility();
     if (gvQuery.HeaderRow != null && gvQuery.HeaderRow.Cells.Count > 0)
         tu.ExportExcel(gvQuery, "FAReturnPCAQuery", Page);
     else
         writeToAlertMessage("Please select one record!"); 
     
 }
Exemplo n.º 5
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(gvQuery, "PCBTestDefect", Page);
 }
    protected void btnExport_Click(object sender, EventArgs e)
    {
        ToolUtility tu = new ToolUtility();
        DataTable dt = (DataTable)gvQuery.DataSource;

        tu.ExportExcel(gvQuery, Page.Title, Page);
    }
Exemplo n.º 7
0
    protected void Button7_Click(object sender, EventArgs e)
    {
        if (GridView1.Rows.Count > 0)
        {
            ToolUtility tu = new ToolUtility();

            tu.ExportExcel(GridView1, "Sheet1", this.Page);
        }
        else
        {
            Response.Write("<script>alert('请查询后再进行导出!')</script>");
            Response.Flush();
        }
        //ToolUtility tu = new ToolUtility();

        //  tu.ExportExcel(GridView1, "Sheet1", this.Page);
                
    }//将数据导出Excel
Exemplo n.º 8
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(gvResult, Page.Title, Page);        
     //MemoryStream ms = ExcelTool.GridViewToExcel(gvResult, "MO查詢");
     //this.Response.ContentType = "application/download";
     //this.Response.AddHeader("Content-Disposition", "attachment; filename=file.xls");
     //this.Response.Clear();
     //this.Response.BinaryWrite(ms.GetBuffer());
     //ms.Close();
     //ms.Dispose();
 }
 protected void btnDetailExcel_Click(object sender, EventArgs e)
 {
     
     ToolUtility t = new ToolUtility();
   t.ExportExcel(grvDetail, "Excel", Page);
  // t.ToExcel(hidGrv1.Value);
     
 }
Exemplo n.º 10
0
 protected void ExportExcel(GridView gv)
 {
     if (GridView1.Rows.Count > 0)
     {
         ToolUtility tu = new ToolUtility();
         tu.ExportExcel(GridView1, "Sheet1", Page);
     }
     else
     {
         Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", "alert('请查出需要导出的数据!')", true);
     }
 }
Exemplo n.º 11
0
 protected void btnDetailExport_Click(object sender, EventArgs e) {
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(gvStationDetail, "PCBInputDetailQuery", Page);
 }
Exemplo n.º 12
0
    protected void btnExport_Click(object sender, EventArgs e)
    {
        ToolUtility tu = new ToolUtility();
        tu.ExportExcel(gvQuery, "SAMBRepair" , Page);

    }
Exemplo n.º 13
0
    protected void btnExport_Click(object sender, EventArgs e)
    {
        if (gvQuery.Rows.Count == 0)
            return;
        ToolUtility tu = new ToolUtility();
        myControls.GridViewExt gv = gvQuery;
        string fileName = "MaterialUsed";
        if ("M".Equals(hidPeriod.Value))
        {
            fileName = "Monthly" + fileName;

            DataTable dt = (DataTable) gvQuery.DataSource;
            DataTable dt2 = new DataTable();
            for (int p = 0; p < gvQuery.HeaderRow.Cells.Count; p++)
                dt2.Columns.Add(gvQuery.HeaderRow.Cells[p].Text);
            for (int i = 0; i < gvQuery.Rows.Count; i++)
            {
                DataRow r = dt2.NewRow();
                for (int j = 0; j < gvQuery.Rows[i].Cells.Count; j++) {
                    if (j == IDX_Monthly)
                        r[j] = "=\"" + gvQuery.Rows[i].Cells[j].Text + "\"";
                    else
                        r[j] = gvQuery.Rows[i].Cells[j].Text;
                }
                dt2.Rows.Add(r);
            }
            gv = new myControls.GridViewExt();
            gv.DataSource = dt2;
            gv.DataBind();
        }
        else if ("Q".Equals(hidPeriod.Value))
        {
            fileName = "Quarterly" + fileName;
        }
        tu.ExportExcel(gv, fileName, Page);
    }
Exemplo n.º 14
0
 public void ExcelOut(GridView gv)
 {
     if (gv.Rows.Count > 0)
     {
         ToolUtility tu = new ToolUtility();
         tu.ExportExcel(dinnertime, "Sheet1", this.Page);
     }
     else
     {
         Response.Write("<script>alert('沒有數據!')</script>");
     }
 }
Exemplo n.º 15
0
 protected void btnExcel_Click(object sender, EventArgs e)
 {
      ToolUtility t = new ToolUtility();
      t.ExportExcel(gvResult, "Excel",Page);
 }
Exemplo n.º 16
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     if (gvQuery.Rows.Count == 0)
         return;
     ToolUtility tu = new ToolUtility();
     myControls.GridViewExt gv = gvQuery;
     string fileName = "SQEReport";
     if ("M".Equals(hidPeriod.Value))
     {
         fileName = "Monthly" + fileName;
     }
     else if ("Q".Equals(hidPeriod.Value))
     {
         fileName = "Quarterly" + fileName;
     }
     tu.ExportExcel(gv, fileName, Page);
 }
Exemplo n.º 17
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(gvQuery, "FAReturnPCAQuery", Page);
 }
Exemplo n.º 18
0
 protected void btnDetailExport_Click(object sender, EventArgs e)
 {
     if (gvStationDetail.HeaderRow == null)
         return;
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(gvStationDetail, "PCBStationDetailQuery", Page);
 }
Exemplo n.º 19
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(gvResult, Page.Title, Page);
 }
Exemplo n.º 20
0
 protected void btnExport_Click(object sender, EventArgs e)
 {
     if (gvQuery.HeaderRow == null)
         return;
     ToolUtility tu = new ToolUtility();
     tu.ExportExcel(gvQuery, "PCBTESTQuery", Page);
 }