Jump to content
Changes to the Jaspersoft community edition download ×

isStretchWithOverflow problem / fonts


scottgute

Recommended Posts

I am running into a problem with a text field truncating the results instead of wrapping the text as it should be. Everything works fine when running locally on an XP workstation, but as soon as we move the reports up to a unix server, it start truncating the results. We are including the fonts in the classpath (the field has the correct font, just not stretching when the value is longer than the field). Here is the report:

 

<?xml version="1.0" encoding="UTF-8"?>

<!-- Created using JasperAssistant (http://www.jasperassistant.com) -->

<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

 

<jasperReport name="providerList_distinctions" columnCount="5" pageWidth="612" pageHeight="791" whenNoDataType="AllSectionsNoDetail" columnWidth="110" columnSpacing="5" leftMargin="1" rightMargin="1" topMargin="1" bottomMargin="1">

<property name="com.jasperassistant.designer.Grid" value="true"/>

<property name="com.jasperassistant.designer.SnapToGrid" value="true"/>

<property name="com.jasperassistant.designer.GridWidth" value="12"/>

<property name="com.jasperassistant.designer.GridHeight" value="12"/>

<property name="com.jasperassistant.designer.Margins" value="true"/>

<property name="com.jasperassistant.designer.Rulers" value="true"/>

<property name="com.jasperassistant.designer.SnapToGuides" value="true"/>

<style name="style_Header" isDefault="false" forecolor="#005044" fontName="Arial Narrow" fontSize="25" pdfFontName="arialn.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

<style name="style_ListHeading_ColorBlock" isDefault="false" forecolor="#FFFFFF" backcolor="#005044" fontName="Arial Narrow" fontSize="10" pdfFontName="arialn.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

<style name="style_ListHeading" isDefault="false" forecolor="#005044" fontName="Arial Narrow" fontSize="9" isBold="true" pdfFontName="arialn.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

<style name="style_address" isDefault="false" fontName="Times New Roman" fontSize="8" pdfFontName="times.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

<parameter name="searchCriteria_string" class="java.lang.String" isForPrompting="false"/>

<parameter name="benefitLevelText" class="java.lang.String">

<defaultValueExpression><![CDATA["Benefit Level"]]></defaultValueExpression>

</parameter>

<queryString language="XPath">

<![CDATA[practitioners/practitioners_row]]>

</queryString>

<field name="loc_prim_state_cd" class="java.lang.String">

<fieldDescription><![CDATA[loc_prim_state_cd]]></fieldDescription>

</field>

<field name="loc_prim_city_nm" class="java.lang.String">

<fieldDescription><![CDATA[loc_prim_city_nm]]></fieldDescription>

</field>

<field name="loc_marketing_nm" class="java.lang.String">

<fieldDescription><![CDATA[loc_marketing_nm]]></fieldDescription>

</field>

<field name="phone_no" class="java.lang.String">

<fieldDescription><![CDATA[phone_no]]></fieldDescription>

</field>

<field name="prv_suffix_dcd" class="java.lang.String">

<fieldDescription><![CDATA[prv_suffix_dcd]]></fieldDescription>

</field>

<field name="loc_prim_zipcode_cd" class="java.lang.String">

<fieldDescription><![CDATA[loc_prim_zipcode_cd]]></fieldDescription>

</field>

<field name="first_nm" class="java.lang.String">

<fieldDescription><![CDATA[first_nm]]></fieldDescription>

</field>

<field name="last_nm" class="java.lang.String">

<fieldDescription><![CDATA[last_nm]]></fieldDescription>

</field>

<field name="pers_prv_suffix_dcd" class="java.lang.String">

<fieldDescription><![CDATA[pers_prv_suffix_dcd]]></fieldDescription>

</field>

<field name="pers_pract_specialty_dcd" class="java.lang.String">

<fieldDescription><![CDATA[pers_pract_specialty_dcd]]></fieldDescription>

</field>

<field name="middle_nm" class="java.lang.String">

<fieldDescription><![CDATA[middle_nm]]></fieldDescription>

</field>

<field name="pers_tier" class="java.lang.String">

<fieldDescription><![CDATA[pers_tier]]></fieldDescription>

</field>

<field name="loc_prim_addr_line_txt1" class="java.lang.String"/>

<field name="loc_prim_addr_line_txt2" class="java.lang.String"/>

<field name="loc_prim_addr_line_txt3" class="java.lang.String"/>

<group name="City">

<groupExpression><![CDATA[$F{loc_prim_city_nm}]]></groupExpression>

</group>

<group name="Specialty">

<groupExpression><![CDATA[$F{pers_pract_specialty_dcd}]]></groupExpression>

</group>

<group name="Provider">

<groupExpression><![CDATA[$F{first_nm}+$F{last_nm}+$F{pers_prv_suffix_dcd}]]></groupExpression>

</group>

<title>

<band height="88" isSplitAllowed="false">

<staticText>

<reportElement style="style_ListHeading" x="0" y="48" width="577" height="37"/>

<textElement>

<font size="25" isBold="true" pdfFontName="arialnb.ttf"/>

</textElement>

<text><![CDATA[Network Providers]]></text>

</staticText>

<line>

<reportElement style="style_ListHeading" x="0" y="13" width="577" height="1" forecolor="#005044"/>

<graphicElement pen="Dotted"/>

</line>

<textField isBlankWhenNull="true">

<reportElement style="style_ListHeading" x="0" y="24" width="577" height="25" forecolor="#000000"/>

<textElement>

<font fontName="Arial Narrow" size="9" pdfFontName="arialnb.ttf" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[new java.lang.String($P{searchCriteria_string}).toUpperCase()]]></textFieldExpression>

</textField>

</band>

</title>

<detail>

<band height="130" isSplitAllowed="false">

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="12" y="56" width="97" height="11" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>

<textElement>

<font fontName="Times New Roman" size="8" isStrikeThrough="false" pdfFontName="times.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{loc_prim_addr_line_txt1}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" x="12" y="89" width="97" height="11" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>

<textElement>

<font fontName="Times New Roman" size="8" isStrikeThrough="false" pdfFontName="times.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{loc_prim_city_nm}+", "+$F{loc_prim_state_cd}+" "+$F{loc_prim_zipcode_cd}.substring(0,5)]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" x="12" y="100" width="80" height="11" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>

<textElement>

<font fontName="Times New Roman" size="8" isStrikeThrough="false" pdfFontName="times.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{phone_no}]]></textFieldExpression>

</textField>

<textField>

<reportElement positionType="Float" x="12" y="111" width="80" height="11" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true">

<printWhenExpression><![CDATA[new Boolean(org.apache.commons.lang.StringUtils.isNotEmpty($F{pers_tier}))]]></printWhenExpression>

</reportElement>

<textElement>

<font fontName="Times New Roman" size="8" pdfFontName="times.ttf" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$P{benefitLevelText}+" "+$F{pers_tier}]]></textFieldExpression>

</textField>

<textField isBlankWhenNull="true">

<reportElement positionType="Float" x="92" y="100" width="18" height="22" isRemoveLineWhenBlank="true">

<printWhenExpression><![CDATA[new Boolean(org.apache.commons.lang.StringUtils.isNotEmpty($F{pers_tier}))]]></printWhenExpression>

</reportElement>

<textElement textAlignment="Right" verticalAlignment="Bottom">

<font fontName="Times New Roman" size="12" pdfFontName="times.ttf" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{pers_tier}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="12" y="67" width="97" height="11" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>

<textElement>

<font fontName="Times New Roman" size="8" isStrikeThrough="false" pdfFontName="times.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{loc_prim_addr_line_txt2}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="12" y="78" width="97" height="11" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>

<textElement>

<font fontName="Times New Roman" size="8" isStrikeThrough="false" pdfFontName="times.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{loc_prim_addr_line_txt3}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true" isBlankWhenNull="true">

<reportElement positionType="Float" x="12" y="40" width="97" height="16" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>

<textElement verticalAlignment="Middle">

<font fontName="Times New Roman" size="8" isStrikeThrough="false" pdfFontName="times.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{loc_marketing_nm}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement style="style_ListHeading" positionType="Float" isPrintRepeatedValues="false" mode="Transparent" x="0" y="29" width="107" height="11" isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>

<textElement textAlignment="Left">

<font fontName="Arial Narrow" size="8" isBold="true" pdfFontName="arialnb.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{last_nm}+", "+$F{first_nm}+" "+$F{middle_nm}+", "+$F{pers_prv_suffix_dcd}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" isPrintRepeatedValues="false" mode="Transparent" x="0" y="16" width="107" height="13" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial Narrow" size="9" isBold="true" isStrikeThrough="false" pdfFontName="arialn.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{pers_pract_specialty_dcd}]]></textFieldExpression>

</textField>

<textField isStretchWithOverflow="true">

<reportElement positionType="Float" isPrintRepeatedValues="false" mode="Opaque" x="0" y="0" width="110" height="12" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#FFFFFF" backcolor="#005044"/>

<textElement textAlignment="Left" verticalAlignment="Top" isStyledText="true">

<font fontName="Arial Narrow" size="10" isBold="true" isStrikeThrough="false" pdfFontName="arialnb.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>

</textElement>

<textFieldExpression class="java.lang.String"><![CDATA[$F{loc_prim_city_nm}]]></textFieldExpression>

</textField>

<line>

<reportElement style="style_ListHeading" positionType="Float" isPrintRepeatedValues="false" x="0" y="14" width="110" height="1" printWhenGroupChanges="City"/>

<graphicElement pen="Dotted"/>

</line>

</band>

</detail>

<pageFooter>

<band height="17">

<staticText>

<reportElement x="0" y="0" width="577" height="12"/>

<textElement textAlignment="Center" verticalAlignment="Middle">

<font fontName="Arial Narrow" size="9" isBold="true" pdfFontName="arialnb.ttf"/>

</textElement>

<text><![CDATA[To get the most up-to-date information, log on as a member at healthpartners.com]]></text>

</staticText>

</band>

</pageFooter>

</jasperReport>

 

 

Can anyone help me with this one, as I have been looking into it now for a couple of days? Thanks.

 

Scott

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi,

 

I'm sure you put the font files in the classpath as you said, but are they installed and available to the JVM?

I bet the "Arial Narrow" is not among the fonts recognized by the JVM on Linux. You could install them on-the-fly using Font.createFont() method.

 

I hope this helps.

Teodor

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...