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 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 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 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 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 }); }
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 ASPxMenu1_ItemClick(object source, MenuItemEventArgs e) { switch (e.Item.Name) { case "btnAdd": FormsHelper.ClearControls(tblControls, new DTO.IdentAtencionDTO()); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add); pnlControls.Visible = true; pnlControls.HeaderText = "Agregar Registro"; break; case "btnEdit": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ClearControls(tblControls, new DTO.IdentAtencionDTO()); var entity = CRUDHelper.Read(FormsHelper.GetSelectedId(gv).Value, BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.IdentAtencion)); FormsHelper.FillControls(entity, tblControls); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit); pnlControls.Attributes.Add("RecId", entity.RecId.ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Modificar Registro"; TipIdentifChanged(); } else { pnlControls.Visible = false; } break; case "btnDelete": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Delete); pnlControls.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Eliminar Registros"; } else { pnlControls.Visible = false; } break; case "btnExport": case "btnExportXls": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WriteXlsToResponse(); } break; case "btnExportPdf": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WritePdfToResponse(); } break; default: break; } }
protected void ASPxButton1_Click(object sender, EventArgs e) { ASPxGridViewExporter1.WritePdfToResponse(); }
protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e) { try { ASPxPageControl1.TabPages[3].ClientEnabled = e.Item.Name == "btnAdd"; switch (e.Item.Name) { case "btnAdd": if (ASPxPageControl1.ActiveTabPage.Index == 3) { //for costosCopy only UcIdentifEspacio0.ComboBox.Text = ""; deVigDesde0.Text = ""; deVigHasta0.Text = ""; } FormsHelper.ClearControls(tblCosto, new DTO.CostosDTO()); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add); CostosFrecuencia = new List <DTO.CostosFrecuenciaDTO>(); CostosProveedor = new List <DTO.CostosProveedorDTO>(); RefreshAbmGrid(gvABMFrecuencia); RefreshAbmGrid(gvABMProveedor); pnlControls.Visible = true; pnlControls.HeaderText = "Agregar Registro"; break; case "btnEdit": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ClearControls(tblCosto, new DTO.CostosDTO()); var entity = Business.Costos.Read(FormsHelper.GetSelectedId(gv).Value); FormsHelper.FillControls(entity, tblCosto); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit); CostosFrecuencia = Business.Costos.ReadAllFrecuencia(entity); CostosProveedor = Business.Costos.ReadAllProveedor(entity); ucEspacioChanged(); rbFrecuenciaChanged(); RefreshAbmGrid(gvABMFrecuencia); RefreshAbmGrid(gvABMProveedor); pnlControls.Attributes.Add("RecId", entity.RecId.ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Modificar Registro"; } else { pnlControls.Visible = false; } break; case "btnDelete": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Delete); pnlControls.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Eliminar Registros"; } else { pnlControls.Visible = false; } break; case "btnCommit": if (FormsHelper.GetSelectedId(gv) != null) { pnlCommit.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).Value.ToString()); pnlControls.Visible = false; pnlCommit.Visible = true; } else { pnlCommit.Visible = false; } break; case "btnQuery": if (FormsHelper.GetSelectedId(gv) != null) { pnlVersiones.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).Value.ToString()); RefreshGrid(gvVersiones); pnlVersiones.Visible = true; } else { pnlVersiones.Visible = false; } break; case "btnExport": case "btnExportXls": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WriteXlsToResponse(); } break; case "btnExportPdf": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WritePdfToResponse(); } break; default: break; } } catch (Exception ex) { FormsHelper.MsgError(lblError, ex); } }
protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnAdd": FormsHelper.ClearControls(tblControls, new DTO.AvisosDTO()); cbIdentifIdentAte.SelectedIndex = -1; FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add); Atencion = new List <DTO.AvisosIdAtenDTO>(); RefreshAbmGrid(gvABM); pnlControls.Visible = true; pnlControls.HeaderText = "Agregar Registro"; trDias.Visible = true; break; case "btnEdit": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ClearControls(tblControls, new DTO.AvisosDTO()); cbIdentifIdentAte.SelectedIndex = -1; var entity = CRUDHelper.Read(FormsHelper.GetSelectedId(gv).Value, DAO); FormsHelper.FillControls(entity, tblControls); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit); Atencion = Business.Avisos.ReadAllAtencion((string)entity.IdentifAviso); gvABM.Attributes.Add("IdentifAviso", entity.IdentifAviso); trDias.Visible = true; RefreshAbmGrid(gvABM); pnlControls.Attributes.Add("RecId", entity.RecId.ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Modificar Registro"; } else { pnlControls.Visible = false; } break; case "btnDelete": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Delete); pnlControls.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Eliminar Registros"; } else { pnlControls.Visible = false; } break; case "btnExport": case "btnExportXls": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WriteXlsToResponse(); } break; case "btnExportPdf": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WritePdfToResponse(); } break; default: break; } } catch (Exception ex) { FormsHelper.MsgError(lblError, ex); } }
protected void ASPxMenu1_ItemClick(object source, MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnAdd": FormsHelper.ClearControls(tblControls, new DTO.FrecuenciaDTO()); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add); pnlDias.Visible = false; Detalles = new List <DTO.FrecuenciaDetDTO>(); RefreshAbmGrid(gvABM); pnlControls.Visible = true; pnlControls.HeaderText = "Agregar Registro"; trDias.Visible = true; rbSemMes.Enabled = true; break; case "btnEdit": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ClearControls(tblControls, new DTO.FrecuenciaDTO()); var entity = CRUDHelper.Read(FormsHelper.GetSelectedId(gv).Value, BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.Frecuencia)); FormsHelper.FillControls(entity, tblControls); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit); Detalles = CRUDHelper.ReadAll(string.Format("IdentifFrecuencia = '{0}'", entity.IdentifFrecuencia), BusinessMapper.GetDaoByEntity(BusinessMapper.eEntities.FrecuenciaDet)); rbSemMes.Enabled = (Detalles.Count == 0); rbSemMesChanged(); gvABM.Attributes.Add("IdentifFrecuencia", entity.IdentifFrecuencia); trDias.Visible = true; RefreshAbmGrid(gvABM); pnlControls.Attributes.Add("RecId", entity.RecId.ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Modificar Registro"; } else { pnlControls.Visible = false; } break; case "btnDelete": rbSemMes.Enabled = (Detalles.Count == 0); if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Delete); pnlControls.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Eliminar Registros"; } else { pnlControls.Visible = false; } break; case "btnExport": case "btnExportXls": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.GridViewID = "gv"; } ASPxGridViewExporter1.WriteXlsToResponse(); break; case "btnExportPdf": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.GridViewID = "gv"; } ASPxGridViewExporter1.WritePdfToResponse(); break; default: break; } } catch (Exception ex) { FormsHelper.MsgError(lblError, ex); } }
protected void ASPxButton1_Click(object sender, EventArgs e) { exportAction = true; ASPxGridViewExporter1.WritePdfToResponse("test.pdf"); }
protected void ASPxButton2_Click(object sender, EventArgs e) { SetHeaderStyle(); ASPxGridViewExporter1.GridViewID = SetGrid(); ASPxGridViewExporter1.WritePdfToResponse(); }
protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e) { try { switch (e.Item.Name) { case "btnAdd": FormsHelper.ClearControls(tblControls, new DTO.MonedasDTO()); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Add); TipoCambio = new List <DTO.TipoCambioDTO>(); RefreshAbmGrid(gvABM); pnlControls.Visible = true; pnlControls.HeaderText = "Agregar Registro"; trDias.Visible = true; break; case "btnEdit": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ClearControls(tblControls, new DTO.MonedasDTO()); var entity = Business.Monedas.Read(FormsHelper.GetSelectedId(gv).Value); FormsHelper.FillControls(entity, tblControls); FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Edit); TipoCambio = Business.Monedas.ReadAllTiposCambio((string)entity.IdentifMon); spDuracion0.Value = null; deVigDesde0.Value = DateTime.Now; gvABM.Attributes.Add("IdentifMon", entity.IdentifMon); trDias.Visible = true; RefreshAbmGrid(gvABM); pnlControls.Attributes.Add("RecId", entity.RecId.ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Modificar Registro"; } else { pnlControls.Visible = false; } break; case "btnDelete": if (FormsHelper.GetSelectedId(gv) != null) { FormsHelper.ShowOrHideButtons(tblControls, FormsHelper.eAccionABM.Delete); pnlControls.Attributes.Add("RecId", FormsHelper.GetSelectedId(gv).ToString()); pnlControls.Visible = true; pnlControls.HeaderText = "Eliminar Registros"; } else { pnlControls.Visible = false; } break; case "btnExport": case "btnExportXls": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WriteXlsToResponse(); } break; case "btnExportPdf": if (ASPxGridViewExporter1 != null) { ASPxGridViewExporter1.WritePdfToResponse(); } break; default: break; } } catch (Exception ex) { FormsHelper.MsgError(lblError, ex); } }