Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] tJasperReportExec and Umlauts

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.
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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:
0683p000009MDj0.png
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.

View solution in original post

18 Replies
Anonymous
Not applicable
Author

Hi,
Did you get tJasperReportExec component from Talend Exchange:https://exchange.talend.com/#marketplaceproductoverview:gallery=marketplace%252F1&pi=marketplace%252...?
Have you already checked component reference?
Best regards
Sabrina
Anonymous
Not applicable
Author

I will check that. Actually I am convinced it should work because it does it for my current project.
Anonymous
Not applicable
Author

Thank you for your replies. Yes, I've doublechecked the reference and the forums both of Jaspersoft and Talend, but I couldn't find anything helpful.
I opened the binary files in a normal editor and found this, which should be "für" and "Größenverteilung":
.jasper from Jaspersoft Studio:
zur Ausbildung für Ihr Unternehmen and Die Größenverteilung
.jasper from Talend tJasperReportExec
zur Ausbildung für Ihr Unternehmen and Die Größenverteilung
I know it's a binary, but to me it looks as if tJasperReportExec somehow doubles the Umlauts while creating the jasper, so it can't be decoded correctly.
Is this helpful?
Other than that I'm as convinced it should work as you are, jlolling, because nobody else asked for help. This tells me I'm the culprit, but I have no idea where to look.
Thanks again in advance.
Anonymous
Not applicable
Author

OK, I have tested it and I can ensure you it works.
 
0683p000009MDZ7.png
Back to your problem. 
Did you spot encoding errors in JasperStudio? 
There are always possible problems with the encoding in the MySQL database which is per default set up with charset LATIN1. I suggest you reconfigure the database (or even the tables with UTF-8).
Anonymous
Not applicable
Author

OK, I have tested it and I can ensure you it works. The PDF is created by a simple Talend job made of a tMysqlConnection and tJasperReportExec.
 
0683p000009MDZ7.png
Back to your problem. 
Did you spot encoding errors in JasperStudio? 
I suggest you build a very simple job - like mine - and test the encoding straight forward to be sure you are at the right place to fix the problem. Perhaps you can post here your job design. 
There are always possible problems with the encoding in the MySQL database which is per default set up with charset LATIN1. I suggest you reconfigure the database (or even the tables with UTF-8).
Here my very simple jrxml:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.1.0.final using JasperReports Library version 5.5.1  -->
<!-- 2015-05-27T07:49:23 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test_umlauts" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="262988c5-a8bf-4cc7-b628-3767e070f2fa">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="local_mysql"/>
<queryString>
<!]>
</queryString>
<field name="umlauts" class="java.lang.String">
<fieldDescription><!]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch">
<staticText>
<reportElement x="190" y="20" width="100" height="30" uuid="acad6421-f00d-4552-a092-69974176f454"/>
<text><!]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="125" splitType="Stretch">
<textField>
<reportElement x="0" y="20" width="550" height="90" uuid="f45d6063-16f1-4d35-8cd5-7380e1a7584c"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="26"/>
</textElement>
<textFieldExpression><!]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
Anonymous
Not applicable
Author

Unfortunately it has nothing to do with MySQL. Text coming from Database is fine. I use "Text Field" and those drive me nuts.
Here is the .jrxml I use:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.0.4.final using JasperReports Library version 6.0.0  -->
<!-- 2015-05-27T15:50:07 -->
<jasperReport xmlns="" xmlns:xsi="" xsi:schemaLocation=" " name="test_pdf" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="9026e51d-fac0-496b-b200-62c15060a142">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="BM_Chemie"/>
<style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="1.5" li


To see the whole post, download it here
OriginalPost.pdf
Anonymous
Not applicable
Author

Did you trieb to Let the component create the jasper file? please provide only the jrxml file and Run the Job again.
Anonymous
Not applicable
Author

Sorry I didnt read your post  fully. My last answer is useless. Are the Talend Job runs  on the same Maschine like your Jasperstudio?
where Do you Run the talend job?
Did you try to run a small  test Report like my suggestion?
Anonymous
Not applicable
Author

Yes, both Jaspersoft Studio and Talend run on the same office computer.
The small test I made first was an extract from a report I made and already delivered before. My first report, though.
This was made out of a lot of graphics and tables, numbers coming from database, and text as introduction to chapters, which I wrote directely into text fields. When I realized that tJasperReportExec created pdfs do not look like Jaspersoft pdfs I made that extract with one table and a text field from my report to test.
Now I tested your .jrxml file. I added a "fünf" to the "umlauts" in your static field. Connected to my database in your text field and added a text field with text. When tJasperReportExec creates the .jasper file it looks like this:

0683p000009MDgl.png
Surprisingly text written in Static Text is fine, text coming from database is fine, text written in Text Field is not.
Not to mention that pdfs from Jaspersoft Studio are always correct. So I'm lost here. Do I miss some settings?