2016-09-03 2 views
5

J'utilise la bibliothèque Jasper Report 6.3 pour exporter mon rapport au format PDF. Quand j'exporter si la longueur de chaîne plus de champ de texte Largeur texte wrap auto jaspe mais dans ce cas une substitution de texte comme image ci-dessousPourquoi est-ce qu'il encapsule du texte dans Jasper Report 6.3?

Problem

Mes propriétés du champ texte:

stretch with overflow, 
left indent: 3px, 
right indent: 8px, 
stretch type: Relative to Tallest object 

échantillon code

<?xml version="1.0" encoding="UTF-8"?> 
<!-- Created with Jaspersoft Studio version 6.2.2.final using JasperReports Library version 6.2.2 --> 
<!-- 2016-09-03T20:46:49 --> 
<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="item_wise_mrp_with_image" pageWidth="595" pageHeight="842" whenNoDataType="BlankPage" columnWidth="575" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" whenResourceMissingType="Key" uuid="b7a946cd-ab42-4abe-b2f7-e616b2d38506"> 
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/> 
    <parameter name="companyName" class="java.lang.String" isForPrompting="false"/> 
    <parameter name="companyAddress" class="java.lang.String" isForPrompting="false"/> 
    <parameter name="quoteNumber" class="java.lang.Integer" isForPrompting="false"/> 
    <parameter name="quoteDate" class="java.util.Date" isForPrompting="false"/> 
    <parameter name="customerName" class="java.lang.String" isForPrompting="false"/> 
    <parameter name="customerAddress" class="java.lang.String"/> 
    <parameter name="emailId" class="java.lang.String" isForPrompting="false"/> 
    <parameter name="city" class="java.lang.String" isForPrompting="false"> 
     <parameterDescription><![CDATA[]]></parameterDescription> 
    </parameter> 
    <parameter name="mobileNo" class="java.lang.String" isForPrompting="false"/> 
    <parameter name="clientMsg" class="java.lang.String"/> 
    <parameter name="m_nrp" class="java.lang.String" isForPrompting="false"/> 
    <parameter name="companyMobile" class="java.lang.String" isForPrompting="false"/> 
    <parameter name="companyEmail" class="java.lang.String" isForPrompting="false"/> 
    <queryString> 
     <![CDATA[]]> 
    </queryString> 
    <field name="totalAmount" class="java.lang.Double"/> 
    <field name="itemCode" class="java.lang.String"/> 
    <field name="itemDescription" class="java.lang.String"/> 
    <field name="quantity" class="java.lang.Integer"/> 
    <field name="mrp" class="java.lang.Double"/> 
    <field name="nrp" class="java.lang.Double"/> 
    <variable name="tqty" class="java.lang.Integer" calculation="Sum"> 
     <variableExpression><![CDATA[$F{quantity}]]></variableExpression> 
    </variable> 
    <variable name="tprc" class="java.lang.Double" calculation="Sum"> 
     <variableExpression><![CDATA[$P{m_nrp}.equals("MRP")? $F{mrp}:$F{nrp}]]></variableExpression> 
    </variable> 
    <variable name="tamt" class="java.lang.Double" calculation="Sum"> 
     <variableExpression><![CDATA[$F{totalAmount}]]></variableExpression> 
    </variable> 
    <background> 
     <band splitType="Stretch"/> 
    </background> 
    <detail> 
     <band height="96" splitType="Stretch"> 
      <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
      <frame> 
       <reportElement x="0" y="0" width="575" height="96" uuid="7beb5f8d-7645-4156-95be-bef2533acba2"> 
        <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
       </reportElement> 
       <box> 
        <leftPen lineWidth="0.25" lineColor="#BFBFBF"/> 
        <bottomPen lineWidth="0.25" lineColor="#BFBFBF"/> 
        <rightPen lineWidth="0.25" lineColor="#BFBFBF"/> 
       </box> 
       <textField> 
        <reportElement stretchType="RelativeToBandHeight" x="0" y="0" width="44" height="96" uuid="8b74ae61-7a6a-4cd7-a70d-857a5e434feb"> 
         <property name="com.jaspersoft.studio.unit.width" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
        </reportElement> 
        <box bottomPadding="2" rightPadding="0"> 
         <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#BFBFBF"/> 
        </box> 
        <textElement textAlignment="Center" verticalAlignment="Middle"> 
         <font fontName="Calibri" size="11"/> 
         <paragraph leftIndent="3" rightIndent="5"/> 
        </textElement> 
        <textFieldExpression><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression> 
       </textField> 
       <textField isStretchWithOverflow="true" isBlankWhenNull="true"> 
        <reportElement stretchType="RelativeToBandHeight" x="45" y="0" width="100" height="96" uuid="b6e44305-fe66-4c42-ac7e-c22827e26baf"> 
         <property name="com.jaspersoft.studio.unit.x" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.width" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
        </reportElement> 
        <box bottomPadding="2" rightPadding="0"> 
         <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#BFBFBF"/> 
        </box> 
        <textElement textAlignment="Left" verticalAlignment="Middle"> 
         <font fontName="Calibri" size="11"/> 
         <paragraph lineSpacingSize="0.0" leftIndent="3" rightIndent="8"/> 
        </textElement> 
        <textFieldExpression><![CDATA[$P{customerAddress}]]></textFieldExpression> 
       </textField> 
       <textField isStretchWithOverflow="true" isBlankWhenNull="true"> 
        <reportElement stretchType="RelativeToBandHeight" x="145" y="0" width="235" height="96" uuid="c7f1aaf5-c7fb-4e24-8283-c9d5a819feef"> 
         <property name="com.jaspersoft.studio.unit.x" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.width" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
        </reportElement> 
        <box bottomPadding="3" rightPadding="0"> 
         <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#BFBFBF"/> 
        </box> 
        <textElement textAlignment="Left" verticalAlignment="Middle"> 
         <font fontName="Calibri" size="11"/> 
         <paragraph lineSpacingSize="0.0" leftIndent="3" rightIndent="12"/> 
        </textElement> 
        <textFieldExpression><![CDATA[$P{clientMsg}]]></textFieldExpression> 
       </textField> 
       <textField> 
        <reportElement key="" stretchType="RelativeToBandHeight" x="380" y="0" width="40" height="96" uuid="70f88651-eefc-49df-898c-5a1eade29bac"> 
         <property name="com.jaspersoft.studio.unit.x" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.width" value="pixel"/> 
         <property name="com.jaspersoft.studio.unit.height" value="pixel"/> 
        </reportElement> 
        <box bottomPadding="2" rightPadding="0"> 
         <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> 
         <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#BFBFBF"/> 
        </box> 
        <textElement textAlignment="Center" verticalAlignment="Middle"> 
         <font fontName="Calibri" size="11"/> 
         <paragraph leftIndent="3" rightIndent="5"/> 
        </textElement> 
        <textFieldExpression><![CDATA[$F{quantity}]]></textFieldExpression> 
       </textField> 
      </frame> 
     </band> 
    </detail> 
</jasperReport> 

T C'est un exemple de code. J'ai utilisé Jasper Studio. Pour reproduire cette erreur entrer ci-dessous les entrées

CustomerAddress: ALD-CHR-769L250X190
clientMsg: Siphon (avec partition interne) 32mm Taille Avec 250mm & 190mm long mur tuyaux de raccordement & Bride murale

Comment puis-je résoudre ce problème?

+0

@PetterFriberg Vérifiez maintenant. Je mets à jour ma question – sakit

Répondre

4

Oui c'est un habituel police-extension problème, j'ai réussi à reproduce votre problème et l'ajout de l'extension de police, il a été résolu.

Voici comment ajouter extension de la police dans JasperSoft Studio, j'ai eu ces paramètres

FontExtension settings

Exécution du rapport après ajouter la police extension le problème a été résolu

Result

Lorsque vous exécutez en dehors de JasperSoft Studio, vous devez créer un fichier d'extension de police (extension vers classpath) si y Vous souhaitez utiliser la police Calibri, sinon changez la police.

+0

Merci beaucoup. – sakit

+0

Désolé je l'ai oublié :) – sakit

+0

Je sais cette question différente mais j'espère que vous pouvez m'aider pour le problème de la frontière. Quand j'exporte en pdf certains lecteurs de pdf n'ont pas montré la frontière à un certain niveau de zoom. Par exemple, Adobe Reader Professional ne pouvait pas afficher 0,25 fine bordure à un niveau de zoom de 50%. Mais à 100% des niveaux de zoom montre. Y at-il de toute façon pour résoudre ce problème – sakit