What a pity: not available as ebook at o’Reilly’s, but you can find it on the web, just as I did.
Blog
-
I started using eRuby to create JasperReport JRXML files
All of a sudden I knew, I would immediately need a template mechanism. During the last “Stuttgart.pm” meet-up Mason got mentioned, but I was already a little familiar with eRuby, so I gave it a try, and it was just the right thing to do. The XML file to handle got smaller and smaller and smaller – really, really nice to see.
Update 2011-03-25:
A few days later I am really rather satisfied with this decision.
Of course: eRuby XML files are no longer clean XML, so they are not supported by any editing mode (apart from “text-mode”) in emacs, but then that’s not too terrible.Update 2011-04-20:
Of course (again) being able to deal with eRuby XML files as XML files within nxml-mode would be a charm. There are 2 obstacles to overcome:In order to interpolate ruby expressions into XML this syntax is used:
y=””
but nxml-mode does not accept that for a legal XML attribute value.
Lines starting with ‘%’ are for ruby code, nxml-mode should / may consider them as comments:% y0 = 97
-
an extra blank page on PDF-s created by JasperReport has gone
The JRXML, I am creating programmatically, caused the generated PDF to have an extra blank page.
I didn’t care a lot, as long as I had not achieved my main goal. Now, that I am going to deliver (OMG!), I tried to smooth that rough edge. As I had not clue, where the problem source really was, I urgently needed to solve that problem today. Spent some time on it, solved it!
My document has only two bands: the Title and the the Background Band.
The Title Band actually doesn’t share the page space with any other band. Therefore I thought it may take all the 842 points of height, that the document has itself. That’s apparently not true. Apparently the Title Band must be at least be one point smaller the available height. If I respect that rule, I don’t have that extra blank page any more.