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); } }
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!"); }
protected void btnDetailExport_Click(object sender, EventArgs e) { ToolUtility tu = new ToolUtility(); tu.ExportExcel(grvDetail, Page.Title, Page); }
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!"); }
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); }
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
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); }
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); } }
protected void btnDetailExport_Click(object sender, EventArgs e) { ToolUtility tu = new ToolUtility(); tu.ExportExcel(gvStationDetail, "PCBInputDetailQuery", Page); }
protected void btnExport_Click(object sender, EventArgs e) { ToolUtility tu = new ToolUtility(); tu.ExportExcel(gvQuery, "SAMBRepair" , Page); }
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); }
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>"); } }
protected void btnExcel_Click(object sender, EventArgs e) { ToolUtility t = new ToolUtility(); t.ExportExcel(gvResult, "Excel",Page); }
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); }
protected void btnExport_Click(object sender, EventArgs e) { ToolUtility tu = new ToolUtility(); tu.ExportExcel(gvQuery, "FAReturnPCAQuery", Page); }
protected void btnDetailExport_Click(object sender, EventArgs e) { if (gvStationDetail.HeaderRow == null) return; ToolUtility tu = new ToolUtility(); tu.ExportExcel(gvStationDetail, "PCBStationDetailQuery", Page); }
protected void btnExport_Click(object sender, EventArgs e) { ToolUtility tu = new ToolUtility(); tu.ExportExcel(gvResult, Page.Title, Page); }
protected void btnExport_Click(object sender, EventArgs e) { if (gvQuery.HeaderRow == null) return; ToolUtility tu = new ToolUtility(); tu.ExportExcel(gvQuery, "PCBTESTQuery", Page); }