Пример #1
0
    protected void btnGenerarReporte_Click(object sender, EventArgs e)
    {
        DateTime?fechaInicio = null;
        DateTime?fechaFin    = null;

        if (txtFechaInicioProduccion.Text != "")
        {
            fechaInicio = DateTime.ParseExact(txtFechaInicioProduccion.Text, "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture);
        }
        if (txtFechaFinProduccion.Text != "")
        {
            fechaFin = DateTime.ParseExact(txtFechaFinProduccion.Text, "yyyy/MM/dd", System.Globalization.CultureInfo.InvariantCulture);
        }
        DataTable dsReporte = Reporte.GenerarReporteGeneral(Utils.ObtenerIdsSeleccionados(lbxCompania), Utils.ObtenerIdsSeleccionados(lbxProducto),
                                                            Utils.ObtenerIdsSeleccionados(lbxPagadurias), Utils.ObtenerIdsSeleccionados(lbxEstadoNegocio), Utils.ObtenerIdsSeleccionados(lbxLocalidad),
                                                            Utils.ObtenerIdsSeleccionados(lbxAgencia), Utils.ObtenerIdsSeleccionados(lbxConvenio), Utils.ObtenerIdsSeleccionados(lbxAsesor),
                                                            Utils.ObtenerIdsSeleccionados(lbxCertificadoRecuperado), fechaInicio, fechaFin);

        Utils.DeshabilitarFormatoExportacion(rvReporte, new string[] { "PDF", "WORD", "WORDOPENXML" });

        rvReporte.ProcessingMode         = ProcessingMode.Local;
        rvReporte.LocalReport.ReportPath = Server.MapPath("~/App_Code/Reportes/ReporteGeneral.rdlc");

        ReportDataSource datasourceResultado1 = new ReportDataSource("dsReporte", dsReporte);

        rvReporte.LocalReport.DataSources.Clear();
        rvReporte.LocalReport.DataSources.Add(datasourceResultado1);
    }