Bom dia a todo!
Pessoal estou com o seguinte problema.
Tenho um relatório construido no Jasper Studio quando testado perfeitamente na ferramenta.
Quando compilo e colóco o ele na aplicação e gero pela aplicação os textos ficam todos no canto esquerdo das colunas.
private void processarDadosPDF(List<PontoExternoVO> collection, Date dataInicio, Date dataFinal) throws Exception {
InputStream report = null;
try {
String relatorio = "PontoExterno.jasper";
String pathSeparator = System.getProperty("file.separator") ;
String dirRelatorioPrincipal = pathSeparator+"relatorios"+pathSeparator+"pontoExterno"+pathSeparator+relatorio;
SimpleDateFormat dtFormat = new SimpleDateFormat("dd/MM/yyyy");
String pathRelatorio = getServletContext().getRealPath(dirRelatorioPrincipal);
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("periodo", dtFormat.format(dataInicio)+" a "+dtFormat.format(dataFinal));
parametros.put("nomeEmpresa", cnpjSelecionado.getRazaoSocial());
report = new FileInputStream(new File(pathRelatorio));
JRDataSource dataSource = new JRBeanCollectionDataSource(collection);
JasperPrint print = JasperFillManager.fillReport(report, parametros, dataSource);
byte[] bytes = getBytes(print);
addAtributoSessao("BYTES_RELATORIO", bytes);
addAtributoSessao("NOME_RELATORIO", "ponto-externo");
// Executa o javascript para exbir o pdf em um popup que chama um servlet.
RequestContext.getCurrentInstance().execute("exibirPopup();");
} catch (Exception e) {
removerAtributoSessao("BYTES_RELATORIO");
removerAtributoSessao("NOME_RELATORIO");
logg.error("Erro ao gerar o relatório de Ponto Externo", e);
throw new Exception();
}
finally {
try {
if(report != null) {
report.close();
}
} catch (Exception e) {
logg.error("Erro ao fechar o report", e);
}
}
}