Search code examples
javaimageimage-processingjasper-reportsomr

creating OMR image for folding machine on each page with JasperReports


Our invoicing system needs to print OMR (optical mark recognition) symbol on each page of our invoices so the folding machine knows what to put in the envelope, so that little PNG picture has to be put on each page. Our invoice is consisted of main report with two subreports created in special .jrxml files. Picture is generated by calling web service with passing page number as a parameter in http request. So, we need to incorporate picture into subreport hoping that subreport will 'know' actual page number when generating document. Error we are getting is:

Error filling print... Could not resolved style(s): pdf 
net.sf.jasperreports.engine.JRRuntimeException: Could not resolved style(s): pdf      at 
net.sf.jasperreports.engine.fill.JRFillObjectFactory.checkUnresolvedReferences(JRFillObjectFactory.java:1610)      at 
net.sf.jasperreports.engine.fill.JRFillObjectFactory.setStyles(JRFillObjectFactory.java:1537)      at 
net.sf.jasperreports.engine.fill.JRBaseFiller.loadStyles(JRBaseFiller.java:962)      at 
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:835)      at 
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:782)      at 
net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:532)      at 
net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:63)      at
 net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:209)      at
 java.lang.Thread.run(Unknown Source)

We are using JasperReports 3.0.0 - migration to newer version requires lot of changes, so that's for now out of option, in case we need to go to newer version.


Solution

  • solved with putting picture onto band called 'background' of main report. Picture is being shown regularly on each page once.