1

I'm creating a pdf file this is my code:

 public ActionResult ImprimirPedido()
        {

            List<ReporteModel> lista = new List<ReporteModel>();

            ReporteModel obj = new ReporteModel();
            obj.Responsable = "juan peres";
            obj.TipoPago = "Efectivo";
            obj.Fecha = "02/05/2014";
            obj.NombreProducto = "chocolate";
            obj.Cantidad = "2";
            obj.Total = "54.00";

            lista.Add(obj);


            string directorio = "~/Models/";
            string urlarchivo = string.Format("{0}.{1}", "Reporte_Disenio", "rdlc");

            string fullpath = string.Format("{0}{1}", this.HttpContext.Server.MapPath(directorio), urlarchivo);

            ReportViewer repor = new ReportViewer();

            repor.Reset();
            repor.LocalReport.ReportPath = fullpath;
            ReportDataSource data = new ReportDataSource("DS_REPORT", lista);
            repor.LocalReport.DataSources.Add(data);
            repor.LocalReport.Refresh();

            byte[] file = repor.LocalReport.Render("PDF");

            return File(new MemoryStream(file).ToArray(),
                System.Net.Mime.MediaTypeNames.Application.Octet,
                string.Format("{0}{1}", "archivo.", "PDF"));

        }

Now I want to print directly on the printer without preview, the printer is installed on my pc with iis. here run my systema mvc4 .net.

  • This can be a complex topic. Please show us relevant code of how you have tried to print your document. Also please take a look at other questions on SO: http://stackoverflow.com/questions/6103705/how-can-i-send-a-file-document-to-the-printer-and-have-it-print or http://stackoverflow.com/questions/5566186/print-pdf-in-c-sharp – sorifiend Apr 24 '17 at 03:28
  • Possible duplicate of [How can I send a file document to the printer and have it print?](http://stackoverflow.com/questions/6103705/how-can-i-send-a-file-document-to-the-printer-and-have-it-print) – sorifiend Apr 24 '17 at 03:29

0 Answers0