1
I have the following view:
public ActionResult RelatorioEquipe()
{
ViewRelatorioEquipeDTO dto = new ViewRelatorioEquipeDTO();
dto.LstUnidadeGerencial = negocio.Relatorio.ObterLstUg();
dto.LstExercicios = new ExercicioNegocio().ObterExerciciosAtivos();
dto.Html = "<img src=\"~/Imagens/LogoMetroRelatorio.png\" style=\"float: left\" />";
return View(dto);
}
dto.Html
is a string and when I refer to my page (cshtml):
<div class="logo">
@Model.Html
</div>
The page naturally shows a string with this text.
The question is: how to instead of showing the string, render this html and display the image?
Just so I understand: what is the need for you to mount HTML in your Controller?
– Leonel Sanches da Silva
It is because my PDF generator only generates PDF through view rendering. In my normal view I have a method that delivers JSON to the page via ajax and updates, but then the PDF cannot generate this update. I replicated the method and sent html back to a new view to generate the pdf.
– Joao Paulo