Jump to content

text-field problem with iReport 4.0.2


sfurlani

Recommended Posts

Hello everybody,

I'm working on a simple test report with iReport 4.0.2 containing only one static text field. I noticed that if i write something in uppercase mode in the text field, in my application the final pdf report is rendered in 2 lines but the preview of iReport is correct.

If I write the same sentence in lowercase the report is rendered correctly. The text field has the width of the page, so it's not a problem of the field. I want to point out that there are no special chars in the text, just letters.

if I use iReport 3.7.6 the problem does not occur, are there any know bugs regarting this scenario?

 

 

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Here I paste my jrxml and attach the final rendering.

Any help would be appreciated!!

Thanks

Stefano

 


 

Code:
<?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="report2" pageWidth="595" pageHeight="842" columnWidth="555" 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"/>    <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"/>    </columnHeader>    <detail>        <band height="125" splitType="Stretch">            <staticText>                <reportElement x="0" y="0" width="555" height="36" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>                <textElement>                    <font size="20"/>                </textElement>                <text><![CDATA[dettaglio del pagamento ricevuto dal test]]></text>            </staticText>            <staticText>                <reportElement x="0" y="36" width="555" height="36" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>                <textElement>                    <font size="20"/>                </textElement>                <text><![CDATA[Dettaglio del pagamento ricevuto dal test]]></text>            </staticText>            <staticText>                <reportElement x="0" y="72" width="555" height="36" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>                <textElement>                    <font size="20"/>                </textElement>                <text><![CDATA[DETTAGLIO DEL PAGAMENTO]]></text>            </staticText>        </band>    </detail>    <columnFooter>        <band height="45" splitType="Stretch"/>    </columnFooter>    <pageFooter>        <band height="54" splitType="Stretch"/>    </pageFooter>    <summary>        <band height="42" splitType="Stretch"/>    </summary></jasperReport>
Link to comment
Share on other sites

  • 1 month later...

bolsover, I think the problem is related to the paragraph implementation in JasperReports 4.0.2 (which has be designed to prevent the problem you are experiencing, more than to introduce it....)

All is related to the PDF font you are using. You should try by using a font extension, instead to relay on the default PDF fonts which may be slightly different from the one used by the java graphics to make size calculations.

 

Giulio

 

Link to comment
Share on other sites

I found that I could solve the problem I had by removing certain characters from the data field causing problems: , ,

For some reason, in some circumstances, these particular codes cause a CR without LF with resultant corrupted output.

When I get time, I'll test with a font extension.

db

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...