Exportar reporte a Excel

This commit is contained in:
2021-07-27 16:28:58 -07:00
parent 71d8953cf7
commit f7fa1a010c
2 changed files with 147 additions and 129 deletions

View File

@@ -58,7 +58,8 @@ public partial class GPS_RepIgnicion : ClsPaginas
DtIgniciones = ObjGPS.DtResultados;
GvIgnicion.DataSource = DtIgniciones;
GvIgnicion.DataBind();
LnkImprimirPDF.Visible = true;
LnkImprimirPDF.Visible = true;
LnkImprimirEXCEL.Visible = true;
}
}
UpDatos.Update();
@@ -104,14 +105,18 @@ public partial class GPS_RepIgnicion : ClsPaginas
protected void LnkImprimirPDF_Click(object sender, EventArgs e)
{
EnviarReporteProgramado();
EnviarReporteProgramado("PDF");
}
protected void LnkImprimirEXCEL_Click(object sender, EventArgs e)
{
EnviarReporteProgramado("EXCEL");
}
public void EnviarReporteProgramado()
public void EnviarReporteProgramado(string Formato = "PDF")
{
if (DtIgniciones != null)
{
byte[] retorno;
string RutaReporte = "Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc";
string RutaReporte = ModExtensiones.DirectorioBaseEmpresas + "Empresas/Grales/ReportesProgramados/RPIgnicion.rdlc";
try
{
@@ -121,10 +126,10 @@ public partial class GPS_RepIgnicion : ClsPaginas
RptParametro.Add(new ReportParameter("UsuarioImprimio", UsuarioActual.Usuario));
RptParametro.Add(new ReportParameter("FechaImpresion", DateTime.Now.ToString("dd/MM/yyyy HH:mm tt")));
retorno = StreamPDF(RutaReporte, DtIgniciones, RptParametro, "ReporteEventos", "PDF", "DsOC");
retorno = StreamPDF(RutaReporte, DtIgniciones, RptParametro, "ReporteEventos", Formato, "DsOC");
// TODO: Labeled Arguments not supported. Argument: 6 := 'MR'
// TODO: Labeled Arguments not supported. Argument: 7 := 'RDSName'
ImprimirbytesPDF(retorno, "ReporteEventos");
ImprimirbytesPDF(retorno, "ReporteEventos", Formato: Formato);
}
catch (Exception ex)
{