protected void AspxMenu1_itemClick(object source, DevExpress.Web.MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnReport": ReportView(); ASPxPopupControl1.ShowOnPageLoad = true; break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; case "btnFind": GetLocationInventory(ASPxDateEdit2.Date, ASPxDateEdit1.Date); break; case "btnCheck": GetHistSku(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void clink_CreateDetailArea(object sender, EventArgs e) { Link self = (Link)sender; for (int i = 0; i < ASPxGridView1.VisibleRowCount; i += ASPxGridView1.SettingsPager.PageSize) { int endIndex = i + ASPxGridView1.SettingsPager.PageSize; DataTable dt = CreateRange(ASPxGridView1, i, endIndex); exportGrid.DataSource = dt; exportGrid.DataBind(); DevExpress.Web.ASPxGridView.Export.Helper.GridViewLink linkdata = new DevExpress.Web.ASPxGridView.Export.Helper.GridViewLink(ASPxGridViewExporter1); linkdata.PrintingSystem = self.PrintingSystem; self.PrintingSystem.InsertPageBreak(0); ASPxGridViewExporter1.DataBind(); BrickModifier skipArea = linkdata.SkipArea; linkdata.SkipArea = self.SkipArea; linkdata.AddSubreport(System.Drawing.PointF.Empty); linkdata.SkipArea = skipArea; } }
protected void CmdExport_Click(object sender, EventArgs e) { //导出 ASPxGridView1.DataSource = dc.GetTable(Session["str"].ToString()); ASPxGridView1.DataBind(); ASPxGridViewExporter1.WriteXlsToResponse("零件替换关系"); }
protected void ASpxMenu1_ItemClick(object source, MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnReport": ASPxPopupControl2.ShowOnPageLoad = true; ReportView(); break; case "btnRefresh": LoadGridView(Convert.ToInt32(Session["IDINCOME"])); break; case "btnBill": ValidarPickinFacturacion(); break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) { if (!ValidarConexionYUsuarioLogueado(source)) { return; } try { switch (e.Item.Name) { case "btnReport": ReportView(); ASPxPopupControl1.ShowOnPageLoad = true; break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; case "btnRefresh": GetStatusInventory(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void Grid_ContextMenuItemClick(object sender, ASPxGridViewContextMenuItemClickEventArgs e) { try { switch (e.Item.Name) { case "ExportToPDF": ASPxGridViewExporter1.WritePdfToResponse(); break; case "ExportToXLS": ASPxGridViewExporter1.WriteXlsToResponse(); break; case "ExportToWORD": ASPxGridViewExporter1.WriteRtfToResponse(); break; case "ExportToCSV": ASPxGridViewExporter1.WriteCsvToResponse(); break; } } catch (Exception ex) { //_Security.ErrorDesscription = ex.Message; //_Security.ErrorModule = "Exporting Corporation Tax Inquiry"; //_Security.SaveError(); } }
protected void Druk(object sender, EventArgs e) { string ident = (string)Session["valueX"]; ASPxGridViewExporter1.Landscape = true; DataTable parameters = cm.makeParameterTable(); parameters.Rows.Add("@ident", ident); string nazwa = string.Empty; try { nazwa = cm.getQuerryValue("SELECT opis FROM konfig WHERE (ident = @ident)", cm.con_str, parameters); } catch { } ASPxGridViewExporter1.ReportHeader = nazwa; Session["exporter"] = ASPxGridViewExporter1; ASPxGridViewExporter1.LeftMargin = 5; ASPxGridViewExporter1.RightMargin = 5; ASPxGridViewExporter1.TopMargin = 0; ASPxGridViewExporter1.BottomMargin = 0; ASPxGridViewExporter1.WritePdfToResponse("kontrolka-" + DateTime.Now.ToShortDateString()); // ScriptManager.RegisterStartupScript(Page, Page.GetType(), "print2", "JavaScript:window.open('kontrolkaDruk.aspx')", true); }
protected void AspxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) { switch (e.Item.Name) { case "btnNew": Session["GridManifiesto"] = null; ASPxGridView2.DataSource = null; ASPxGridView2.DataBind(); GetPicking(); break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; case "btnPdf": ASPxGridViewExporter1.Landscape = true; ASPxGridViewExporter1.WritePdfToResponse(); break; case "btnReport": ReportViewer(); ASPxPopupControl1.ShowOnPageLoad = true; break; } }
protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnExport": { ASPxGridViewExporter1.GridViewID = "gv"; XlsExportOptions xlsOpciones = new XlsExportOptions(TextExportMode.Text, true, false); ASPxGridViewExporter1.DataBind(); ASPxGridViewExporter1.WriteXlsToResponse(xlsOpciones); break; } case "btnLimpiar": { gv.DataSource = null; gv.DataBind(); mnuPrincipal.Items[0].Enabled = false; break; } default: break; } } catch (Exception ex) { string a = ex.Message; } }
protected void ASPxButton1_Click(object sender, EventArgs e) { MemoryStream memoryStream1 = new MemoryStream(); MemoryStream memoryStream2 = new MemoryStream(); MemoryStream memoryStream3 = new MemoryStream(); MemoryStream myZippedStream = new MemoryStream(); ASPxGridViewExporter1.WriteXlsx(memoryStream1); ASPxGridViewExporter2.WriteXlsx(memoryStream2); ASPxGridViewExporter3.WriteXlsx(memoryStream3); memoryStream1.Seek(0, SeekOrigin.Begin); memoryStream2.Seek(0, SeekOrigin.Begin); memoryStream3.Seek(0, SeekOrigin.Begin); using (ZipArchive archive = new ZipArchive()) { archive.AddStream("grid1.xlsx", memoryStream1); archive.AddStream("grid2.xlsx", memoryStream2); archive.AddStream("grid3.xlsx", memoryStream3); archive.Save(myZippedStream); } Response.Clear(); Response.ContentType = "application/zip"; Response.AddHeader("Content-Disposition", "attachment; filename=exportFiles.zip"); Response.AddHeader("Content-Length", myZippedStream.Length.ToString()); Response.BinaryWrite(myZippedStream.ToArray()); Response.Flush(); Response.Close(); Response.End(); }
protected void ASPxButton1_Click(object sender, EventArgs e) { var exportOptions = new XlsxExportOptionsEx(); exportOptions.CustomizeCell += exportOptions_CustomizeCell; ASPxGridViewExporter1.WriteXlsxToResponse(exportOptions); }
protected void btnXlsExport_Click(object sender, EventArgs e) { ASPxGridView1.Columns.RemoveAt(26); ASPxGridView1.Columns.RemoveAt(25); ASPxGridView1.Columns.RemoveAt(24); ASPxGridView1.Columns.RemoveAt(23); ASPxGridView1.Columns.RemoveAt(22); ASPxGridView1.Columns.RemoveAt(21); ASPxGridView1.Columns.RemoveAt(20); ASPxGridView1.Columns.RemoveAt(19); ASPxGridView1.Columns.RemoveAt(18); ASPxGridView1.Columns.RemoveAt(17); ASPxGridView1.Columns.RemoveAt(16); ASPxGridView1.Columns.RemoveAt(15); ASPxGridView1.Columns.RemoveAt(14); ASPxGridView1.Columns.RemoveAt(13); ASPxGridView1.Columns.RemoveAt(12); ASPxGridView1.Columns.RemoveAt(11); GridViewDataTextColumn d3 = new GridViewDataTextColumn(); d3.Caption = "客户"; d3.VisibleIndex = 7; d3.FieldName = "CUSTOMER_NAME"; ASPxGridView1.Columns.Add(d3); GridViewDataTextColumn d1 = new GridViewDataTextColumn(); d1.Caption = "备注"; d1.VisibleIndex = 17; d1.FieldName = "REMARK"; ASPxGridView1.Columns.Add(d1); ASPxGridViewExporter1.WriteXlsToResponse("导出计划"); }
protected void AspxMenuItem1(object source, DevExpress.Web.MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnUpdate": ASPxPopupControl1.ShowOnPageLoad = true; break; case "btnFind": LoadGridView(Convert.ToInt32(ASPxSpinEdit2.Number)); break; case "btnReport": ReportView(); ASPxPopupControl2.ShowOnPageLoad = true; break; case "btnRefresh": LoadGridView(Convert.ToInt32(Session["IDINCOME"])); break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void AspxMenu1_itemClick(object source, DevExpress.Web.MenuItemEventArgs e) { switch (e.Item.Name) { case "btnFind": DataSet ds; try { var pResult = ""; ds = _objTask.GetAllTask(Session["connectionString"].ToString(), ASPxDateEdit2.Date, ASPxDateEdit1.Date, ref pResult); if (pResult == "") { Session["DATA_TASK"] = ds; ASPxGridView1.DataSource = ds; ASPxGridView1.DataBind(); } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } break; case "btnReport": ReportView(); ASPxPopupControl1.ShowOnPageLoad = true; break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; case "btnAll": try { var pResult = ""; ds = _objTask.GetAllTaskToday(Session["connectionString"].ToString(), ref pResult); if (pResult == "") { Session["DATA_TASK"] = ds; ASPxGridView1.DataSource = ds; ASPxGridView1.DataBind(); } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } break; } }
protected void LinkButton2_Click(object sender, EventArgs e) { ASPxGridViewExporter1.Styles.AlternatingRowCell.BackColor = System.Drawing.Color.LightGray; ASPxGridViewExporter1.WritePdfToResponse("Lista Spraw", false, new DevExpress.XtraPrinting.PdfExportOptions() { ShowPrintDialogOnOpen = true }); }
protected void BtnExport_Click(object sender, EventArgs e) { string sql = Session["mmsMaterialSend001"] as string; ASPxGridView1.DataSource = dc.GetTable(sql); ASPxGridView1.DataBind(); ASPxGridViewExporter1.WriteXlsToResponse(); }
protected void BtnExport_Click(object sender, EventArgs e) { DataTable table1 = Session["MaterialSend_YXH"] as DataTable; ASPxGridView1.DataSource = table1; ASPxGridView1.DataBind(); ASPxGridViewExporter1.WriteXlsToResponse("柳汽发料打印--导出"); }
protected void btnXlsExport_Click(object sender, EventArgs e) { DataTable table1 = Session["rept3400table"] as DataTable; ASPxGridView1.DataSource = table1; ASPxGridView1.DataBind(); ASPxGridViewExporter1.WriteXlsToResponse("乱序附装领料单导出"); }
protected void Excell(object sender, EventArgs e) { ASPxGridViewExporter1.WriteXlsxToResponse("kontrolka - " + DateTime.Now.ToShortDateString()); /*ASPxGridViewExporter1.DataBind(); * Session["exporter"] = ASPxGridViewExporter1; * ScriptManager.RegisterStartupScript(Page, Page.GetType(), "print2", "JavaScript:window.open('kontrolkaExcell.aspx')", true); */ }
protected void btnXlsExport1_Click(object sender, EventArgs e) { string sql = Session["2800ONLINE"].ToString(); DataTable dt = dc.GetTable(sql); ASPxGridView3.DataSource = dt; ASPxGridView3.DataBind(); ASPxGridViewExporter1.WriteXlsToResponse("在制品物料清单导出" + DateTime.Now.ToString() + ".xls"); }
protected void AspxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnFind": try { if (Convert.ToDateTime(ASPxDateEdit1.Date) > Convert.ToDateTime(ASPxDateEdit2.Date)) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('La fecha de inicio debe de ser menor a la final.');", true); break; } var pResult = ""; var ds = _objPicking.GetAllPicking(Session["connectionString"].ToString(), Convert.ToDateTime(ASPxDateEdit1.Date), Convert.ToDateTime(ASPxDateEdit2.Date), ref pResult); if (pResult == "") { Session["datosPicking"] = ds; if (ds.Tables[0].Rows.Count > 0) { ASPxGridView1.DataSource = ds; ASPxGridView1.DataBind(); //LoadOperator(); //LoadClient(); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('" + pResult + "');", true); } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError(Error: '" + ex.Message + "');", true); } break; case "btnReport": ReportView(); ASPxPopupControl1.ShowOnPageLoad = true; break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void grid_ContextMenuItemClick(object sender, ASPxGridViewContextMenuItemClickEventArgs e) { switch (e.Item.Name) { case "ExportToPDF": ASPxGridViewExporter1.WritePdfToResponse(); break; case "ExportToXLS": ASPxGridViewExporter1.WriteXlsToResponse(); break; } }
protected void drucz(object sender, EventArgs e) { ASPxGridView1.DataSource = (DataTable)Session["danedotabeli"]; ASPxGridView1.AutoGenerateColumns = true; ASPxGridView1.DataBind(); ASPxGridViewExporter1.Landscape = true; ASPxGridViewExporter1.WritePdfToResponse("ocena.pdf", false, new DevExpress.XtraPrinting.PdfExportOptions() { ShowPrintDialogOnOpen = true }); }
//导出计划表 EXCEL protected void btnXlsExport_Click1(object sender, EventArgs e) { ////ASPxGridView subGrid = (ASPxGridView)this.masterGrid.Items[intRow].FindControl("subGrid"); //string plineName = Convert.ToString(ASPxGridView1.GetRowValues(ASPxGridView1.FocusedRowIndex, "PLINE_NAME")); //Console.WriteLine(plineName); //ASPxGridView grid = (ASPxGridView)this.ASPxGridView1; //int rowNum = Convert.ToInt16(ASPxGridView1.FocusedRowIndex); //grid.GetRow(rowNum); ////ASPxGridView1.Columns[3].Visible = false; //setCondition(); ASPxGridViewExporter1.WriteXlsToResponse("Plan_List"); }
protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) { if (!ValidarConexionYUsuarioLogueado(source)) { return; } try { switch (e.Item.Name) { case "UiBotonGenerarReporte": GenerarReporte(); ASPxPopupControl5.ShowOnPageLoad = true; break; case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; case "btnGeo": ObtnerRegistrosFiltrados(); switch (rblPuntos.SelectedItem.Value.ToString()) { case "Facturas": ActualizaListaPuntosFacturacion(1, 0); break; case "Clientes": ActualizaListaPuntosFacturacion(0, 1); break; default: ActualizaListaPuntosFacturacion(1, 1); break; } PopupPoligonos.ShowOnPageLoad = true; break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }
protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) { switch (e.Item.Name) { case "btnExcel": try { ASPxGridViewExporter1.WriteXlsxToResponse(); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } break; } }
protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.MenuItemEventArgs e) { if (ValidarConexionYUsuarioLogueado(source)) { switch (e.Item.Name) { case "btnExcel": ASPxGridViewExporter1.WriteXlsxToResponse(); break; case "btnReport": ReportView(); ASPxPopupControl5.ShowOnPageLoad = true; break; } } }
protected void ASPxButton1_Click(object sender, EventArgs e) { if (ASPxGridView1.GroupCount == 0) { ASPxGridViewExporter1.WritePdfToResponse(); } else { string groupField = ASPxGridView1.GetGroupedColumns()[0].FieldName; object[] groupValues = FindGroupValues(ASPxGridView1); PrintingSystem ps = new PrintingSystem(); Link clink = new Link(ps); clink.CreateDetailArea += new CreateAreaEventHandler(delegate(object sender2, CreateAreaEventArgs e2) { Link self = (Link)sender2; for (int i = 0; i < groupValues.Length; i++) { DevExpress.Web.ASPxGridView.Export.Helper.GridViewLink linkdata = new DevExpress.Web.ASPxGridView.Export.Helper.GridViewLink(ASPxGridViewExporter1); linkdata.PrintingSystemBase = self.PrintingSystem; if (i > 0) { self.PrintingSystem.InsertPageBreak(0); } string filter = ASPxGridView1.FilterExpression; ASPxGridView1.FilterExpression = new GroupOperator(GroupOperatorType.And, CriteriaOperator.Parse(filter), new BinaryOperator(groupField, groupValues[i])).ToString(); ASPxGridView1.ExpandAll(); ASPxGridViewExporter1.DataBind(); BrickModifier skipArea = linkdata.SkipArea; linkdata.SkipArea = self.SkipArea; linkdata.AddSubreport(System.Drawing.PointF.Empty); linkdata.SkipArea = skipArea; ASPxGridView1.FilterExpression = filter; } }); clink.CreateDocument(); ps.PageSettings.Landscape = true; System.IO.MemoryStream stream = new System.IO.MemoryStream(); ps.ExportToPdf(stream); WriteToResponse("export", true, "pdf", stream); stream.Close(); } }
protected void Page_Load() { try { if (Page.IsPostBack) { Mostrado = 1; gv.DataSource = Tabla; gv.DataBind(); } if (!Page.IsPostBack) { Mostrado = 0; } if (Mostrado == 0) { AnioMes = Request.QueryString["AnioMes0"]; Estado = Request.QueryString["Estado0"]; Origen = Request.QueryString["Origen0"]; Mostrado = Convert.ToInt32(Request.QueryString["Mostrado0"]); ArmarCabecera(); DataRow f1 = Tabla.NewRow(); Tabla.Rows.Add(f1); AgregarTotales(); DataRow f2 = Tabla.NewRow(); Tabla.Rows.Add(f2); AgregarPorcentajes(); Mostrado = 0; } ASPxGridViewExporter1.GridViewID = "gv"; ASPxGridViewExporter1.DataBind(); } catch (Exception ex) { string a = ex.Message; } }
protected void mnuPrincipal_ItemClick(object source, MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnExport": { ASPxGridViewExporter1.GridViewID = "gv"; gv.DataSource = Tabla; ASPxGridViewExporter1.DataBind(); if (ASPxGridViewExporter1 != null) { XlsExportOptions xlsExportOptions = new XlsExportOptions(TextExportMode.Text, true, false); string Titulo = ucEstado.Text.Trim() + " - " + ucOrigen.Text.Trim() + " " + deAnoMes.Text; xlsExportOptions.SheetName = Titulo; ASPxGridViewExporter1.WriteXlsToResponse(xlsExportOptions); } break; } case "btnLimpiar": { gv.DataSource = null; gv.DataBind(); break; } default: break; } } catch (Exception ex) { } }