Exemple #1
0
        public async Task <ActionResult> Reporte(ViewReporteBusqueda viewReporte)
        {
            // Buscar Info
            ApiCall api      = new ApiCall(Session);
            var     response = await api.PostAsync("/api/Reporte", viewReporte);

            List <Reporte_Ventas> informacion = new List <Reporte_Ventas>();

            if (response.IsSuccessStatusCode)
            {
                var datastring = await response.Content.ReadAsStringAsync();

                informacion = JsonConvert.DeserializeObject <List <Reporte_Ventas> >(datastring);
            }
            // Cargar origen de Datos
            DataTable dt = new DataTable();

            dt = ConvertToDataTable(informacion);

            // Diseño del reporte
            ReportViewer reportViewer = new ReportViewer();

            reportViewer.ProcessingMode      = ProcessingMode.Local;
            reportViewer.SizeToReportContent = true;
            reportViewer.Width       = Unit.Percentage(100);
            reportViewer.Height      = Unit.Percentage(100);
            reportViewer.ZoomMode    = ZoomMode.Percent;
            reportViewer.ZoomPercent = 165;

            reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Report\ReportVentas.rdlc";
            reportViewer.LocalReport.DataSources.Add(new ReportDataSource("Data", dt));

            ViewBag.ReportViewer = reportViewer;
            return(View());
        }
 public IEnumerable <ConsultarReporteVentasResult> GetReporte(ViewReporteBusqueda viewReporteBusqueda)
 {
     return(db.ConsultaReporteVentas(viewReporteBusqueda.Fecha));
 }