After tryingseveral optionsI fail todeploya report andI am not gettinganyspecific error.
I am developingin VisualStudio 2010withMVC3Razor.
I havea viewto invoice
This is part of the view:
@model Models.FacturaHeaderModel @{ ViewBag.Title = "Facturación de Compras"; Layout = "~/Views/Shared/_Layout.cshtml"; } @using (Html.BeginForm("Guardar", "Facturas", FormMethod.Post, new { id = "factura" })) { <fieldset> <div class="editor-label" style="font-size:16px;"> @Html.LabelFor(m => m.Movimiento.DescripLarga) <div class="editor-field"> @Html.TextBoxFor(m => m.Movimiento.DescripLarga, new { @readonly = "readonly", style = "font-weight: bold;font-size:16px;" }) </div> </div> .... </fieldset> <input type="submit" name="Guardar" id="guardar" title="Guardar" value="Guardar" /> }
This is part of ActionResult
[AcceptVerbs(HttpVerbs.Post)] public ActionResult Guardar(FacturaHeaderModel model, FormCollection formCollection) { if (ModelState.IsValid) { ..... save data....... var reporte = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + @"rpt\Factura.rpt"; var rptH = new ReportClass { FileName = reporte }; rptH.Load(); var cnn = new ReportHelper(); cnn.Connect(ref rptH); //connect database rptH.RecordSelectionFormula = "{CtaCteCliente.CtaCteClienteId}=" + facturaId; var stream = rptH.ExportToStream(ExportFormatType.PortableDocFormat); return File(stream, "application/pdf"); } }
For some reasonthough thereport is designedproperly andfrom the designerworking properlyand after makingseveral attempts todebug thecode to detectthat is wrongdoes not seem tobeanything unusual.
Some queries:
This error maybe caused bythe type of responseexpected byvisual studio?
Is there anyway to getcrystal reportserrorin previousversionsassomething like:
rptH.LastError