0
I have several reports made in Jaspersoft that generate PDF and when generated in Java, when downloading the report on my pc, it is as "Document.pdf". How do I name this report differently, for example "reportario_clients.pdf"? The reports were assembled by Jaspersoft and my application is in Java and spring to call the report do the following:
@GetMapping("/clientes")
public ModelAndView gerarRelatoriosClientes(@AuthenticationPrincipal UsuarioSistema usuarioSistema) throws MalformedURLException, IOException {
HashMap<String, Object> parametros = new HashMap<String, Object>();
parametros.put("codigoEmpresa", usuarioSistema.getUsuario().getEmpresa().getCodigo());
parametros.put("format", "pdf");
return new ModelAndView("relatorio_clientes", parametros);
}
Can someone help me?
Where is the code using jasperReport that you create the PDF?. Post it please
– Marquezani
Thus, it is a jrxml made in Jaspersoft, it is very extensive for all here, follows the beginning and end of it:
– Fernando Beleboni
In the application has a class called Webconfig, where I have all the cofigurations, the responsible method for detecting japer is this:
– Fernando Beleboni
Jasperreportsviewresolver resolver = new Jasperreportsviewresolver(); resolver.setPrefix("classpath:/reports/"); resolver.setSuffix(".Jasper"); resolver.setViewNames("report_*"); resolver.setViewClass(Jasperreportsmultiformatview.class); resolver.setJdbcDataSource(datasource); resolver.setOrder(0); Return resolve;
– Fernando Beleboni