protected void btnGenerarExcelTotales_Click(object sender, EventArgs e) { string datos = Util.RenderNovedadesTotales(novedadesTotales); string datosFiltrosDeSeleccion = String.Empty; // = Util.RenderFiltros(ObtenerFiltrosDeSeleccion()); ArchivoConFiltrosDeSeleccionDTO archivo = new ArchivoConFiltrosDeSeleccionDTO(obtenerTituloArchivoConFecha("NovedadesTotales", "xls"), "vnd.ms-excel", "Novedades Totales", datos, datosFiltrosDeSeleccion); ExportadorArchivosNovedades exportador = new ExportadorArchivosNovedades(); exportador.ExportarExcel(archivo); }
public override void ExportarExcel(ArchivoDTO archivo) { ArchivoConFiltrosDeSeleccionDTO miArchivo = (ArchivoConFiltrosDeSeleccionDTO)archivo; StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); EscribirCabeceraFiltroDeSeleccion(sw); sw.Write(EscribirFiltros(miArchivo.DatosFiltrosDeSeleccion)); sw.Write(EscribirTitulo(miArchivo.Titulo)); sw.Write(EscribeLinea(archivo.Datos)); sw.Write(EscribePiePagina()); Mostrar(sw, archivo); }
protected void btnGenerarExcel_Click(object sender, EventArgs e) { DataGrid dg = new DataGrid(); dg.DataSource = lstNovedadesInventario; dg.DataBind(); string datos = Util.RenderControl(dg); string datosFiltrosDeSeleccion = Util.RenderFiltros(ObtenerFiltrosDeSeleccion()); ArchivoConFiltrosDeSeleccionDTO archivo = new ArchivoConFiltrosDeSeleccionDTO(obtenerTituloArchivoConFecha("NovedadesInventario", "xls"), "vnd.ms-excel", "Novedades Inventario", datos, datosFiltrosDeSeleccion); ExportadorArchivosNovedades exportador = new ExportadorArchivosNovedades(); exportador.ExportarExcel(archivo); }