iReport: adding QRCode to Jasper reports the easy way

After testing various complicated solutions to embed a QR Code into iReport Jasper reports, the easiest way I’ve found is this:

1) Put ZXing’s Core and JavaSE jars in the classpath (using Tools/Options/Classpath if compiling locally, or the classpath property if using Ant and net.sf.jasperreports.ant.JRAntCompileTask)

2) Add an image to your report with the following settings:

  • Expression Class:
  • Image Expression :
   , 300, 300))

    Of course, replace $F{CONTENT_TO_ENCODE} with your actual content.

3) Compile the report and enjoy !

15 comments on “iReport: adding QRCode to Jasper reports the easy way

  1. Si subes tu reporte a jasper server con tomcat, necesitas copiar estos dos archivo en jasperreports-server-xx-x.x.x/apache-tomcat/webapps/jasperserver/WEB-INF/lib
    Recuerda reiniciar el jasper server.
    In order to run this report in jasper server. You need to copy this files to jasperreports-server-xx-x.x.x/apache-tomcat/webapps/jasperserver/WEB-INF/lib
    Don’t forget to restart jasperserver

  2. Thank you, how to about how to generate 2d pdf417 in ireport ???

Leave a Reply

news for few, stuff no-one cares about