Search code examples
grailsjasper-reports

Jasper PDF download local is not the same as PDF production


I built my system in grails and when I download my Pdf in my development(local), my report goes really nice. But when I put on production(another machine ubuntu) and download on it, the report goes bad. Keep cutting words, some $P{...} goes a little up. Why does it happen?

Look at this: image

  • The dates "Iníci" should be "Início" and Términ should be "Término".
  • The "Selo (Bentonita +" doesn't end with ")", because is cutting the word.
  • The dates "03/03/2015" and "05/03/2015" is little up

In my local, everything is aligned and the labels are showing everything.


Solution

  • Add the jasperreports-font dependency to your BuildConfig.groovy:

    dependencies {
        runtime 'net.sf.jasperreports:jasperreports-fonts:6.0.0'
    }
    

    and in your report use only DejaVu fonts.

    That should make sure you see the same report in development and production.