Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    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);
    }