Text with tab characters (ascii #9) is not properly rendered when saved to PDF



when text fields contains tab characters, the text is correctly displayed when previewed on screen through iReport but part of text is missing when I save the report to PDF. I have made a very small report that reproduce this problem. I have attached the report XML source file as well as the PDF file created.

As you can see in the PDF output, line #6 and line #9 are missing from the PDF file. But if you preview the report into iReport, you can see all 10 lines of text without any problem.

Can somebody help me about this?

Can it be a bug?

I'm using iReport 4.7.1

Thanks for any help anybody could provide me about this strange behaviour.


dev_1313's picture
Joined: Dec 12 2012 - 5:38pm
Last seen: 1 year 12 months ago
I've the same problem. I've also tried the new version (5.0) w/o any luck. -- Stefano
stxg - 8 years 2 months ago

1 Answer:

<?xml version="1.0" encoding="UTF-8"?>
<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="report1" language="groovy" pageWidth="792" pageHeight="612" orientation="Landscape" whenNoDataType="AllSectionsNoDetail" columnWidth="752" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<band height="92" splitType="Stretch"/>
<band height="125" splitType="Stretch"/>
<band height="54" splitType="Stretch"/>
<band height="88">
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="752" height="81"/>
<textElement markup="none">
<font size="48"/>
<textFieldExpression class="java.lang.String"><![CDATA["Line 01/10: chr(9) here:[ ]\n \n \n"+ "Line 02/10: chr(9) here:[ ]\n \n \n"+ "Line 03/10: chr(9) here:[ ]\n \n \n"+ "Line 04/10: chr(9) here:[ ]\n \n \n"+ "Line 05/10: chr(9) here:[ ]\n \n \n"+ "Line 06/10: chr(9) here:[ ]\n \n \n"+ "Line 07/10: chr(9) here:[ ]\n \n \n"+ "Line 08/10: chr(9) here:[ ]\n \n \n"+ "Line 09/10: chr(9) here:[ ]\n \n \n"+ "Line 10/10: chr(9) here:[ ]\n \n \n"]]></textFieldExpression>
Use this code I have made very small chnages now all line are coming.Hope it will help you.
shariquerasheed92's picture
Joined: Sep 17 2014 - 11:38pm
Last seen: 3 months 1 day ago

Could you tell me which section did you change exacly?
Thank you.

gplante2 - 6 years 4 months ago