0
I’m having trouble generating a report on mvc, using the rotary. The problem is that it generates the pdf, as if I have been ignoring the html, it is all without formatting.
ob.: for htm formatting, it’s css in external file.
I’m calling it that way:
[HttpGet]
public ActionResult ImprimeRequerimento(int processoId)
{
var requerimento = _processoAppServico.ObterRequerimentoProcesso(processoId);
var v = new ViewAsPdf
{
ViewName = "RequerimentoProcesso",
Model = requerimento
};
return v;
}
view html:
@model GestaoProcesso.Aplicacao.ViewModels.ProcessoViewModel
@{
Layout = "null";
}
<h2>ObterRequerimento</h2>
<link href="~/Content/relReqProcesso.css" rel="stylesheet" />
<div class="table-wrap col-lg-11">
<div class="box">
<div class="box-body table-responsive no-padding">
<table class="table">
<tbody>
<tr>
<td class="modulos" colspan="4">Dados do Processo:</td>
</tr>
<tr>
<th class="nomeCampo" colspan="4">Nome do requerente / Razão Social</th>
</tr>
<tr>
<td class="valorCampo" colspan="4">@Html.DisplayFor(model => model.NomeCLiente)</td>
</tr>
<tr>
<th class="nomeCampo">
RG
</th>
<th class="nomeCampo">
Orgão
</th>
<th class="nomeCampo">
Data de Emissão
</th>
<th class="nomeCampo">
CPF/CNPJ
</th>
</tr>
<tr>
<td class="valorCampo">@Html.DisplayFor(model => model.Bairro)</td>
<td class="valorCampo"></td>
<td class="valorCampo"></td>
<td class="valorCampo">@Html.DisplayFor(model => model.Complemento)</td>
</tr>
<tr>
<th class="nomeCampo" colspan="4">
Endereço / CEP
</th>
</tr>
<tr>
<td class="campoCinza" colspan="4">@Html.DisplayFor(model => model.Rua)</td>
</tr>
<tr>
<th class="nomeCampo">
Telefone
</th>
<th class="nomeCampo" colspan="3">
Email
</th>
</tr>
<tr>
<td class="valorCampo">@Html.DisplayFor(model => model.Descricao)</td>
<td class="valorCampo" colspan="3">@Html.DisplayFor(model => model.Data)</td>
</tr>
<tr>
<td class="modulos" colspan="4">Dados do Processo:</td>
</tr>
<tr>
<th class="nomeCampo" colspan="2">
Registro IPTU
</th>
<th class="nomeCampo" colspan="2">
INSCRIÇÃO MERCANTIL
</th>
</tr>
<tr>
<td class="valorCampo" colspan="2"></td>
<td class="valorCampo" colspan="2"></td>
</tr>
<tr>
<td class="modulos" colspan="4">Solicitação do Processo:</td>
</tr>
<tr>
<th class="nomeCampo" colspan="4">
Assunto
</th>
</tr>
<tr>
<td class="valorCampo" colspan="4"></td>
</tr>
<tr>
<th class="nomeCampo" colspan="4">
Descrição
</th>
</tr>
<tr>
<td class="valorCampo" colspan="4" style="height 25vh;"></td>
</tr>
<tr>
<td class="modulos" colspan="4"></td>
</tr>
<tr>
<th class="nomeCampo" colspan="3">
Assinatura
</th>
<th class="nomeCampo">
Data
</th>
</tr>
<tr>
<td class="valorCampo" colspan="3"><p /></td>
<td class="valorCampo"><p /></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
How is the View
RequerimentoProcesso
? You can put it in the question?– Leonel Sanches da Silva
I put the view html and a print of how PDF looks. vlw
– Ricardo Soares
Guys, has anyone ever had a similar problem, and who can help me? Thanks
– Ricardo Soares
I can give you an answer, but it involves trading the Rotary for another package. It will suit you?
– Leonel Sanches da Silva
i’m taking a look at the reportviewer, but can indicate @Ciganomorrisonmendez, no problems.
– Ricardo Soares