Instalei a package "Install-Package MvcReportViewer" via Package Manager Console e ao tentar criar o ReportViewer dá um erro de não encontrada a referência.
Meu código:
View
@using MvcReportViewer; <-- Aqui dá erro
<h2>Invoice</h2>
@using (Html.BeginForm("Index", "RelatorioInvoice", FormMethod.Post))
{
<div>
<label>
<span>Invoice/Credit note: </span>
@Html.TextBox("Range1", "", new { @class = "form-control form-control-custom", style = "width:100px;" })
<span> até </span>
@Html.TextBox("Range2", "", new { @class = "form-control form-control-custom", style = "width:100px;" })
<span>Série: </span>
@Html.TextBox("txtSerie", "", new { @class = "form-control form-control-custom", style = "width:50px", maxlength = "2" })
<span>Tipo: </span>
@Html.TextBox("Tipo", "", new { @class = "form-control form-control-custom", style = "width:50px;", maxlength = "2" })
<span>CIA: </span>
@Html.DropDownList("ItemsListCIA", null, "Sel...", new { @class = "form-control form-control-custom", style = "width:90px;" })
<input class="btn btn-padrao-bv" type="submit" id="btnPesquisar" value="Pesquisar"/>
@Html.ActionLink("Comentário", "Comentario", null , new { target = "_blank", @class="modal-link" })
</label>
<p>
<label>
@ViewBag.Message
</label>
</p>
</div>
}
<script type="text/javascript">
$(function () {
$('body').on('click', '.modal-link', function (e) {
e.preventDefault();
$(this).attr('data-target', '#modal-container');
$(this).attr('data-toggle', 'modal');
});
$('body').on('click', '.modal-close-btn', function () {
$('#modal-container').modal('hide');
});
$('#modal-container').on('hidden.bs.modal', function () {
$(this).removeData('bs.modal');
});
$('#CancelModal').on('click', function () {
return false;
});
});
</script>
<div style="margin-top: 20px;">
@Html.MvcReportViewer(
"/TestReports/TestReport",
new { Parameter1 = "Hello World!", Parameter2 = DateTime.Now, Parameter3 = 12345, Parameter4 = DateTime.UtcNow },
new { Height = 900, Width = 900, style = "border: none" })
<div id="modal-container" class="modal fade comentario-modal"
tabindex="-1" role="dialog">
</div>
</div>