protected void gvNationality_GridExporting1(object sender, GridExportingArgs e) { switch (e.ExportType) { case ExportType.Excel: // string css = "<style> body { border:solid 0.1pt #CCCCC; }</style>"; //e.ExportOutput = e.ExportOutput.Replace("</head>", css + "</head>"); break; case ExportType.ExcelML: //do something with the e.ExportOutput value break; case ExportType.Word: //do something with the e.ExportOutput value break; case ExportType.Csv: //do something with the e.ExportOutput value break; case ExportType.Pdf: //you can't change the output here - use the PdfExporting event instead break; } }
internal static void OnGridExporting(object sender, GridExportingArgs e) { if (e.ExportType == ExportType.Word) { e.ExportOutput = e.ExportOutput.Replace("<body>", "<body><div class=WordSection1>"); e.ExportOutput = e.ExportOutput.Replace("</body>", "</div></body>"); } }
protected void rdgTxns_GridExporting(object sender, GridExportingArgs e) { if (e.ExportType == ExportType.Excel) { string css = "<style> td {text-align:center}</style>"; e.ExportOutput = e.ExportOutput.Replace("</head>", css + "</head>"); } }
protected void RadGrid1_GridExporting(object sender, GridExportingArgs e) { using (FileStream fs = new FileStream(String.Format("{0}.{1}", PhysicalPathToFile, RadComboBox1.SelectedValue), FileMode.Create)) { byte[] output = Encoding.GetEncoding(WesternEuropean).GetBytes(e.ExportOutput); fs.Write(output, 0, output.Length); } Response.Redirect(Request.Url.GetLeftPart(UriPartial.Path).ToString()); }
void Grid_GridExporting(object source, GridExportingArgs e) { log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); try { GridFunctions.HandleGridExporting(Grid, Me.Grid, source, e, this.Page.Response); } catch (Exception ex) { log.Error(ex); throw ex; } }
protected void rgDatos_GridExporting(object sender, GridExportingArgs e) { //Insertar encabezado en las primeras filas de la hoja de excel string customHTML = "<div style='text-align:center; font-weight:bold; font-size:1.25em;'>Reporte</div>" + "<div style='text-align:center; font-weight:bold; font-size:1.25em;'>SAF</div>" + "<div style='text-align:center; font-weight:bold; font-size:1.25em;'>" + Nombremodulo + "</div><br />"; e.ExportOutput = e.ExportOutput.Replace("<body>", String.Format("<body>{0}", customHTML)); }
protected void gvNationality_GridExporting(object source, GridExportingArgs e) { }
protected void GridView1_GridExporting(object sender, GridExportingArgs e) { }
public static void HandleGridExporting(RadGrid Grid, Grid grid, object source, GridExportingArgs e, HttpResponse Response) { if (e.ExportType == ExportType.Csv) { Response.ContentType = "application/csv"; Response.AddHeader("Content-Type", "text/csv"); Response.BinaryWrite(new ASCIIEncoding().GetBytes(e.ExportOutput)); Response.End(); } }
protected void RadGrid1_OnGridExporting(object sender, GridExportingArgs e) { Helper.GirdHelper.OnGridExporting(sender, e); }
protected void RG_PurchaseSet_GridExporting(object source, GridExportingArgs e) { e.ExportOutput = e.ExportOutput.Replace("\"0", "=\"0"); }