Exemplo n.º 1
0
        public IHttpActionResult Get(DateTime fecha_inicial, DateTime fecha_final)
        {
            try
            {
                using (DeliveryEntidades1 db = new DeliveryEntidades1())
                {
                    try
                    {
                        //List<rptCantidadProductos11_Result> todos = ReporteBLL.listProductos();
                        return(Content(HttpStatusCode.OK, ReporteBLL.listVentasCategoriasxMes(fecha_inicial, fecha_final)));
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error al enviar reporte de Ventas por mes " + ex.Message);
                        throw ex;
                    }
                }
            }
            catch (Exception ex)
            {
                return(NotFound());

                throw ex;
            }
        }
Exemplo n.º 2
0
        public IHttpActionResult Get(Boolean activo)
        {
            try
            {
                using (DeliveryEntidades1 db = new DeliveryEntidades1())
                {
                    try
                    {
                        //List<rptCantidadProductos11_Result> todos = ReporteBLL.listProductos();
                        return(Content(HttpStatusCode.OK, ReporteBLL.listMontoAgrupado()));
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine("Error al enviar reporte de monto agrupado " + ex.Message);
                        throw ex;
                    }
                }
            }
            catch (Exception ex)
            {
                return(NotFound());

                throw ex;
            }
        }
Exemplo n.º 3
0
        protected void BtnAceptar_Click(object sender, EventArgs e)
        {
            if (FechaInicio.Text == "" || FechaFin.Text == "")
            {
                LbMensaje.Text    = "Debe seleccionar fechas";
                LbMensaje.Visible = true;
            }

            else
            {
                LbMensaje.Visible = false;


                DateTime   FechaInicioReporte    = DateTime.Parse(FechaInicio.Text);
                DateTime   FechaFinReporte       = DateTime.Parse(FechaFin.Text);
                ReporteBLL GestorReporte         = new ReporteBLL();
                List <ReporteDeVentasEntidad> ve = new List <ReporteDeVentasEntidad>();

                ve = GestorReporte.ReporteEntreFechas(FechaInicioReporte, FechaFinReporte);



                ReportViewer1.LocalReport.DataSources.Clear();

                ReportDataSource ds = new ReportDataSource("ReporteEntreFechas", ve);

                ReportViewer1.LocalReport.DataSources.Add(ds);

                ReportViewer1.ProcessingMode         = ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = "Reportventas.rdlc";
                ReportViewer1.LocalReport.Refresh();
            }
        }
Exemplo n.º 4
0
        private void ExportarPDF()
        {
            if (FechaInicio.Text == "" || FechaFin.Text == "")
            {
                LbMensaje.Text    = "Debe seleccionar fechas";
                LbMensaje.Visible = true;
            }

            else
            {
                LbMensaje.Visible = false;

                DateTime FechaInicioReporte = DateTime.Parse(FechaInicio.Text);
                DateTime FechaFinReporte    = DateTime.Parse(FechaFin.Text);

                ReporteBLL GestorReporte         = new ReporteBLL();
                List <ReporteDeVentasEntidad> ve = new List <ReporteDeVentasEntidad>();

                Warning[] warnings;
                string[]  streamIds;
                string    contentType;
                string    encoding;
                string    extension;
                string    deviceInfo = @"<DeviceInfo>
                      <OutputFormat>EMF</OutputFormat>
                      <PageWidth>8.5in</PageWidth>
                      <PageHeight>11in</PageHeight>
                      <MarginTop>0.25in</MarginTop>
                      <MarginLeft>0.25in</MarginLeft>
                      <MarginRight>0.25in</MarginRight>
                      <MarginBottom>0.25in</MarginBottom>
                    </DeviceInfo>";


                ve = GestorReporte.ReporteEntreFechas(FechaInicioReporte, FechaFinReporte);

                ReportDataSource ds = new ReportDataSource("ReporteEntreFechas", ve);
                ReportViewer1.ProcessingMode         = ProcessingMode.Local;
                ReportViewer1.LocalReport.ReportPath = "Reportventas.rdlc";
                ReportViewer1.LocalReport.DataSources.Add(ds);
                ReportViewer1.LocalReport.Refresh();

                //Export the RDLC Report to Byte Array.
                byte[] bytes = ReportViewer1.LocalReport.Render("PDF", deviceInfo, out contentType, out encoding, out extension, out streamIds, out warnings);

                //Download the RDLC Report in Word, Excel, PDF and Image formats.
                Response.Clear();
                Response.Buffer  = true;
                Response.Charset = "";
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.ContentType = contentType;
                Response.AppendHeader("Content-Disposition", "attachment; filename=RDLC." + extension);
                Response.BinaryWrite(bytes);
                Response.Flush();
                Response.End();
            }
        }
Exemplo n.º 5
0
        public IHttpActionResult GetReportes(int productos)
        {
            List <rptTiendaProducto_Result> tienda = ReporteBLL.Get(productos);

            /*if (user == null)
             * {
             *  return Content(HttpStatusCode.OK, user);
             * }*/
            return(Content(HttpStatusCode.OK, tienda));
        }
 public IHttpActionResult Get()
 {
     try
     {
         List <rptSexo_Result> todos = ReporteBLL.Get();
         return(Content(HttpStatusCode.OK, todos));
         //return Json(todos);
     }
     catch (Exception ex)
     {
         return(Content(HttpStatusCode.BadRequest, ex));
     }
 }