Hi all,
I managed to create a job that loops through a MySQL-Table and saves PDFs of a Jasperreport for each ID.
When I have Jaspersoft Studio create the .jasper files, the output of tables aren't correct. For example cells aren't centered or font is too big where I made it smaller to fit the cell.
When I delete all .jasper files and have Talend tJasperReportExec create them, format is perfect, but in text fields I have no Umlauts. Text in tables that comes from Database is fine.
Text Fields are styled and font is Sans serif, nothing special here.
I use:
Jaspersoft Studio 6.04 (with compatibility set to 5.5.1 or other makes no difference)
Talend Open Studio for Data Integration 5.6.1
tJasperReportExec 1.11
All local on Windows 8.1 PC.
If you need more information I'll be happy to provide it.
Thanks a lot in advance.
Ah, ok this could be caused by the read of the jrxml file with the wrong character set. I have dived in the source code of the library and see there is no file encoding setting and also not for the writing of the file. I will check if I can take care the file will always read with UTF-8. I come back here when I can reproduce this and have a solution. As long as we have a solution you could try bundles to add localised texts.
To be in danger driving you creasy here is my own test and it convinced my, there is something wrong with your way to write the jrxml file:
The way the wrong encoding is showing is very typical for a reading of an text file with the wrong char set.
Could you check if the char set of the jrxml file is UTF-8. Perhaps you open it with UltraEdit with fix setup UTF-8 encoding.
Please test if it works if you add a tJava with this code:
System.setProperty("file.encoding", "UTF-8");
before the jasper comp. It changes the default encoding and this way your file should be read correctly.
I have made some slight changes to this component to be sure the JRXML file will be read in UTF-8 encoding regardless what is set as default encoding. I habe uploaded an new test release (1.16) here:
http://jan-lolling.de/talend/components/tJasperReportExec.zip Could you give it a try?
Perfect, that's the solution. Thank you very much indeed. The reports run fine and show Umlauts in all their glory.
In my "real" report only one damn Text Field refused cooperation, but with this one I started to play with the encodings, so no problem here. The rest is as it should.
So thanks again and have a nice weekend!
Great to hear. Did you tried the piece of code or the new release of the component. Actually both ways handles the same problem (the new release does not need the global setting and should be the one for further development).
I tried the 1.16 Release from your link, because I missed your other post (and was wondering which piece of code you were talking about).
But I'll test the code, too, just a little bit busy at the moment.
The .jrxml files are all utf-8, I checked this when I started. All I can say is I didn't change anything in configuration, but that doesn't say I can't do anything wrong.
I'll test the code tomorrow!
I meant this piece of code in a tJava:
System.setProperty("file.encoding", "UTF-8");
But you do not have to test it. The update of the component is the better way.
I will update the release also in Talend Exchange.
Thanks a lot for your tests and your feedback!
gsczuka....can you post a screenshot of your tJasperReportExec component settings? i'm trying to do the same thing as you, but am having a difficult time with the parameters