Good morning everyone! I'm trying to print a logo in the Jasper Reports report if I put the address " link " works,
But I wanted to put the path of the image that is inside my application (eg "../images/logo.png")
follow below structure
Good morning everyone! I'm trying to print a logo in the Jasper Reports report if I put the address " link " works,
But I wanted to put the path of the image that is inside my application (eg "../images/logo.png")
follow below structure
Good morning everyone! I was able to resolve it by doing the following:
I created a parameter in the report called LOGO_DIR which corresponds to the folder of images of my system
and filled in the report call
ClassReport.java ...
FacesContext fc = FacesContext.getCurrentInstance();
ServletContext context = (ServletContext)fc.getExternalContext().getContext();
String path = context.getRealPath(File.separator) + "resources/jasper" + File.separator;
String logo = context.getRealPath(File.separator) + "resources/images" + File.separator;
params.put("SUBREPORT_DIR", path);
params.put("LOGO_DIR", logo);
Within the report, in jasper, I created a String field that receives the LOGO_DIR + "image_name.png"