I'm having trouble generating a report in mvc, using the rotary. The problem is that it generates the pdf, as if I have been ignoring the html, it is all unformatted.
ob: for htm formatting, it's css in an external file.
I'm calling it like this:
[HttpGet]
public ActionResult ImprimeRequerimento(int processoId)
{
var requerimento = _processoAppServico.ObterRequerimentoProcesso(processoId);
var v = new ViewAsPdf
{
ViewName = "RequerimentoProcesso",
Model = requerimento
};
return v;
}
html view:
@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>