Eliminar filas en blanco para archivo TXT. Delete rows in blanks TXT file.

0

I have a ,jrxml file. 

<?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="StatiscalInformationOperationBranchInsurance" language="groovy" pageWidth="70" pageHeight="70" columnWidth="50" leftMargin="0" rightMargin="0"
topMargin="0" bottomMargin="0" isIgnorePagination="true">
    <property name="ireport.zoom" value="1.5"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <property name="net.sf.jasperreports.export.text.character.width" value="7.238"/>
    <property name="net.sf.jasperreports.export.text.character.height" value="13.948"/>
    <field name="branch_code" class="java.lang.String">
        <fieldDescription><![CDATA[branch_code]]></fieldDescription>
    </field>
    <field name="state_code" class="java.lang.String">
        <fieldDescription><![CDATA[state_code]]></fieldDescription>
    </field>
    <field name="amount_counted" class="java.lang.String">
        <fieldDescription><![CDATA[amount_counted]]></fieldDescription>
    </field>
    <detail>
        <band height="20" splitType="Stretch">
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement positionType="Float" x="0" y="0" width="70" height="20" isRemoveLineWhenBlank="true">
                    <printWhenExpression><![CDATA[$F{branch_code} != null]]></printWhenExpression>
                </reportElement>
                <textFieldExpression><![CDATA[$F{branch_code} + "|" + $F{state_code} + "|" + $F{amount_counted} + "|;" + "\n"]]></textFieldExpression>
            </textField>
        </band>
    </detail>
</jasperReport>

This file generate this output

31|2|36|;  
 
31|4|18|;  
 
 
31|9|2|;   
 
31|99|6|;  

I requiire to delete rows in blanks. That to show like thiis.

31|2|36|;  
31|4|18|; 
31|9|2|;   
31|99|6|;

Please i wait your help. Thanks you.

deivy.ramirez's picture
Joined: Sep 11 2019 - 2:02pm
Last seen: 9 months 2 weeks ago

1 Answer:

0

Why do you add a linebreak "+\n" within your TextFieldExpression?? This is causing an empty line after each filled textfield because it increases the actual textfield height.

So just remove this unnecessary break and you will be happy. :-)

hth + regards 

C-Box

C-Box's picture
2373
Joined: Jul 19 2006 - 5:58pm
Last seen: 1 month 7 hours ago
Feedback
randomness