I'm trying create a report using JasperReports to my application. What happens is when I do some change at JasperReports does not update in my application.
I tried refresh my project, refresh my browser and always displayed report without changes
I'm trying this
public class ImprimeListaChamadaReport {
private Turma turma;
private final String pathJasper = "br/com/webapp/reports/jasper/ListaDeChamadas.jasper";
public ImprimeListaChamadaReport(Turma t){
this.turma = t;
createReport();
}
private void createReport(){
final Map map = new HashMap();
final JRDataSource ds = new JRBeanCollectionDataSource(turma.getMatriculas());
StreamResource.StreamSource source = new StreamResource.StreamSource() {
public InputStream getStream() {
byte[] b = null;
try {
b = JasperRunManager.runReportToPdf(getClass().getClassLoader().getResourceAsStream(pathJasper), map, ds);
} catch (JRException ex) {
ex.printStackTrace();
}
return new ByteArrayInputStream(b);
}
};
StreamResource resource = new StreamResource(source, "ListaDeChamadas.pdf");
resource.setMIMEType("application/pdf");
Embedded e = new Embedded("", resource);
e.setSizeFull();
e.setMimeType("application/pdf");
e.setType(Embedded.TYPE_BROWSER);
ReportWindow w = new ReportWindow("Lista de chamada", e);
UI.getCurrent().addWindow(w);
}
}
I posted the images. I did change "Hellooooo" and when I do display doesn't changed.
Any idea ?
The problem is seldom with .jasper
file coming from the cache. A quick solution to this is clear your server's working directory and clean the server.
If this still does not help, delete the .jasper
file maually before you redeploy your application. And than later on refresh the project.
Hope this solves the issue.