0

我有一个用JasperReports制作的报告,我用Java打印它。

最近我升级到JDK7 (7.25 x64),现在当我打印所有字体时都是粗体

我很困惑,因为报告在JDK6上运行良好,jrxml 如下:

<?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="InformeCobranzas" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="565" leftMargin="15" rightMargin="15" topMargin="20" bottomMargin="20" uuid="84a26930-1d64-44e4-be6a-44f740e0d61b">
    <property name="ireport.zoom" value="0.8467108950806665"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <property name="net.sf.jasperreports.export.xls.column.width.ratio" value="1.30f"/>
    <parameter name="PERIODO" class="java.lang.String">
        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>
    </parameter>
    <parameter name="EMPRESA" class="java.lang.String">
        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>
    </parameter>
    <parameter name="DOMICILIO" class="java.lang.String">
        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>
    </parameter>
    <parameter name="LOCALIDAD" class="java.lang.String">
        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>
    </parameter>
    <parameter name="CUIT" class="java.lang.String">
        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>
    </parameter>
    <parameter name="FECHA" class="java.util.Date" isForPrompting="false">
        <defaultValueExpression><![CDATA[Calendar.getInstance().getTime()]]></defaultValueExpression>
    </parameter>
    <parameter name="CONCEPTO" class="java.lang.String">
        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>
    </parameter>
    <parameter name="LEGAJO" class="java.lang.String">
        <defaultValueExpression><![CDATA[""]]></defaultValueExpression>
    </parameter>
    <parameter name="FILTRO" class="java.lang.String">
        <defaultValueExpression><![CDATA["mes"]]></defaultValueExpression>
    </parameter>
    <parameter name="ORDEN" class="java.lang.String">
        <defaultValueExpression><![CDATA["to_number(legajo, '99999999')"]]></defaultValueExpression>
    </parameter>
    <parameter name="CENTRO_COSTO" class="java.lang.Integer">
        <defaultValueExpression><![CDATA[0]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![CDATA[SELECT
legajo,
nombre,
cuit,
fecha_alta,
sueldo_basico,
SUM(horas) AS horas,
SUM(total_haberes) AS total_haberes,
SUM(total_deducciones) AS total_deducciones,
SUM(total_no_remunerativos) AS total_no_remunerativos,
SUM(total_comprobante) AS total_comprobante,
$P!{FILTRO} AS periodo
FROM
informe_listado_sueldos
WHERE (ccos_id = $P{CENTRO_COSTO} OR $P{CENTRO_COSTO} = 0) $P!{PERIODO} $P!{CONCEPTO} $P!{LEGAJO}
GROUP BY
legajo,
nombre,
cuit,
fecha_alta,
sueldo_basico,
$P!{FILTRO}
ORDER BY
$P!{ORDEN}]]>
    </queryString>
    <field name="legajo" class="java.lang.String"/>
    <field name="nombre" class="java.lang.String"/>
    <field name="cuit" class="java.lang.String"/>
    <field name="fecha_alta" class="java.sql.Date"/>
    <field name="sueldo_basico" class="java.math.BigDecimal"/>
    <field name="horas" class="java.math.BigDecimal"/>
    <field name="total_haberes" class="java.math.BigDecimal"/>
    <field name="total_deducciones" class="java.math.BigDecimal"/>
    <field name="total_no_remunerativos" class="java.math.BigDecimal"/>
    <field name="total_comprobante" class="java.math.BigDecimal"/>
    <field name="periodo" class="java.lang.String"/>
    <variable name="Bruto" class="java.math.BigDecimal" calculation="Sum">
        <variableExpression><![CDATA[$F{sueldo_basico}]]></variableExpression>
    </variable>
    <variable name="Haberes" class="java.math.BigDecimal" calculation="Sum">
        <variableExpression><![CDATA[$F{total_haberes}]]></variableExpression>
    </variable>
    <variable name="NoRem" class="java.math.BigDecimal" calculation="Sum">
        <variableExpression><![CDATA[$F{total_no_remunerativos}]]></variableExpression>
    </variable>
    <variable name="Deduc" class="java.math.BigDecimal" calculation="Sum">
        <variableExpression><![CDATA[$F{total_deducciones}]]></variableExpression>
    </variable>
    <variable name="Neto" class="java.math.BigDecimal" calculation="Sum">
        <variableExpression><![CDATA[$F{total_comprobante}]]></variableExpression>
    </variable>
    <background>
        <band splitType="Stretch"/>
    </background>
    <pageHeader>
        <band height="86" splitType="Stretch">
            <staticText>
                <reportElement uuid="b48ab656-5913-40e2-a77b-ca2bde84ef49" x="0" y="0" width="565" height="20"/>
                <textElement textAlignment="Center">
                    <font fontName="Verdana" isBold="true"/>
                </textElement>
                <text><![CDATA[LISTADO DE SUELDOS]]></text>
            </staticText>
            <textField isStretchWithOverflow="true" pattern="###0;-###0" isBlankWhenNull="true">
                <reportElement uuid="7a6cfac2-5d37-47d8-9c0b-52112ede5b1f" positionType="Float" stretchType="RelativeToTallestObject" x="536" y="24" width="29" height="14"/>
                <textElement textAlignment="Right">
                    <font fontName="Verdana" size="10" isBold="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement uuid="069b9a98-436f-4d3f-ba29-3650a6a11308" positionType="Float" stretchType="RelativeToTallestObject" x="456" y="24" width="80" height="14"/>
                <box rightPadding="5"/>
                <textElement textAlignment="Right">
                    <font fontName="Verdana" size="10" isBold="true"/>
                </textElement>
                <text><![CDATA[HOJA:]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="24b235e8-1112-405b-b668-57dfc4c07c3e" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="66" width="73" height="14"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Verdana" size="9" isBold="true"/>
                </textElement>
                <text><![CDATA[C.U.I.T.:]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="495e1d67-6283-48bc-86fc-807e1d777837" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="52" width="73" height="14"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Verdana" size="9" isBold="true"/>
                </textElement>
                <text><![CDATA[LOCALIDAD:]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="952cf00b-732d-4c6d-83ea-1245f0b3e6f0" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="24" width="73" height="14"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Verdana" size="9" isBold="true"/>
                </textElement>
                <text><![CDATA[EMPRESA:]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="5096c5eb-a82a-4086-bd21-06593606cead" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="38" width="73" height="14"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="Verdana" size="9" isBold="true"/>
                </textElement>
                <text><![CDATA[DOMICILIO:]]></text>
            </staticText>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement uuid="da149e02-fa3b-42bb-9ebf-1df8ff4a2bda" positionType="Float" stretchType="RelativeToTallestObject" x="73" y="24" width="232" height="14"/>
                <textElement>
                    <font fontName="Verdana"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{EMPRESA}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement uuid="b1912990-d181-4d32-9bec-b7c7ea9a7b26" positionType="Float" stretchType="RelativeToTallestObject" x="73" y="38" width="232" height="14"/>
                <textElement>
                    <font fontName="Verdana"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{DOMICILIO}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement uuid="63997635-ca75-4bf2-82b2-29cc0adcc638" positionType="Float" stretchType="RelativeToTallestObject" x="73" y="52" width="232" height="14"/>
                <textElement>
                    <font fontName="Verdana"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{LOCALIDAD}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement uuid="2a38d31c-e445-4298-b507-2639c378ecd2" positionType="Float" stretchType="RelativeToTallestObject" x="73" y="66" width="232" height="14"/>
                <textElement>
                    <font fontName="Verdana"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{CUIT}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement uuid="83d5a9f6-2b1e-4cbb-88c6-5b9ddf43629c" positionType="Float" stretchType="RelativeToTallestObject" x="456" y="66" width="109" height="14"/>
                <textElement textAlignment="Right">
                    <font fontName="Verdana"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{periodo}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement uuid="e4a27d37-b22b-4cdc-a551-e784ccf0f4a6" positionType="Float" stretchType="RelativeToTallestObject" x="305" y="66" width="151" height="14"/>
                <textElement textAlignment="Right" markup="none">
                    <font fontName="Verdana" isBold="true"/>
                </textElement>
                <text><![CDATA[PERIODO:]]></text>
            </staticText>
            <textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
                <reportElement uuid="e647a52f-edbb-40ae-a214-5302e72927c5" positionType="Float" stretchType="RelativeToTallestObject" x="456" y="52" width="109" height="14"/>
                <textElement textAlignment="Right">
                    <font fontName="Verdana"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{FECHA}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement uuid="926dbdcb-1ca3-4a6e-bc30-95847ba0bcb6" positionType="Float" stretchType="RelativeToTallestObject" x="305" y="52" width="151" height="14"/>
                <textElement textAlignment="Right" markup="none">
                    <font fontName="Verdana" isBold="true"/>
                </textElement>
                <text><![CDATA[FECHA:]]></text>
            </staticText>
        </band>
    </pageHeader>
    <columnHeader>
        <band height="25" splitType="Stretch">
            <staticText>
                <reportElement uuid="26902b05-2091-4a0e-82f4-37a280f70a85" positionType="Float" x="0" y="6" width="30" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[Legajo]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="92d48b97-d82d-4d63-b71d-a5b1ca3f2572" positionType="Float" x="30" y="6" width="120" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Left" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[Apellido y Nombre]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="f1e8046d-0b76-41e3-a3a8-6f4ef9d90732" positionType="Float" x="150" y="6" width="65" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[C.U.I.L.]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="e8b5cd39-35c4-4c49-84ba-2b80043b35f6" positionType="Float" x="215" y="6" width="50" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[F. Ingreso]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="19b65e5d-6bd7-41df-bdc1-7df9d81e888a" positionType="Float" x="348" y="6" width="55" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[Bruto]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="7f527b1c-2fe0-4ba1-a5a7-c7ae8d7791e1" positionType="Float" x="403" y="6" width="54" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[No Remun.]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="51e82327-aee3-4843-9a93-5e24695b8b4c" positionType="Float" x="513" y="6" width="52" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[Neto]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="0774d9fe-f700-406a-a32d-c734470b5b2a" positionType="Float" x="305" y="6" width="43" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[Básico]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="03c7b69a-81b2-4ad4-bd0e-8c4f60a775db" positionType="Float" x="457" y="6" width="56" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[Deducciones]]></text>
            </staticText>
            <staticText>
                <reportElement uuid="b215d86d-5573-4eaa-9a93-ce84030e6d67" positionType="Float" x="265" y="6" width="40" height="18"/>
                <box>
                    <topPen lineWidth="1.0"/>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[Horas]]></text>
            </staticText>
        </band>
    </columnHeader>
    <detail>
        <band height="20">
            <elementGroup>
                <rectangle>
                    <reportElement uuid="9c876c3c-5573-4395-a05f-1343c41812df" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="565" height="20" forecolor="#000000" backcolor="#E5ECFD"/>
                    <graphicElement>
                        <pen lineWidth="0.0" lineStyle="Solid"/>
                    </graphicElement>
                </rectangle>
                <rectangle>
                    <reportElement uuid="75dfdb1c-7eef-42e5-bc6a-97a8a3396efc" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="565" height="20" forecolor="#000000" backcolor="#DCDCC8">
                        <printWhenExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue() % 2 == 0)]]></printWhenExpression>
                    </reportElement>
                    <graphicElement>
                        <pen lineWidth="0.0" lineStyle="Solid"/>
                    </graphicElement>
                </rectangle>
                <textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
                    <reportElement uuid="a128ad5e-50df-417b-9d65-603cf0647b7a" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="30" height="20"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{legajo}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement uuid="83787301-65e8-4c4d-a2db-93ae7b4dd9fc" positionType="Float" stretchType="RelativeToTallestObject" x="30" y="0" width="120" height="20"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{nombre}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                    <reportElement uuid="ff526b05-5a5c-4790-b405-99bc474cae91" positionType="Float" stretchType="RelativeToTallestObject" x="150" y="0" width="65" height="20"/>
                    <textElement verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{cuit}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
                    <reportElement uuid="d53d27f5-06ce-4534-951a-14ed440a93f5" positionType="Float" stretchType="RelativeToTallestObject" x="215" y="0" width="50" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{fecha_alta}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                    <reportElement uuid="004aced2-9ef2-4814-bbe6-565d59d04d82" positionType="Float" stretchType="RelativeToTallestObject" x="305" y="0" width="43" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{sueldo_basico}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                    <reportElement uuid="e3d020af-45e1-4900-b07c-a5f1f4eb5ff9" positionType="Float" stretchType="RelativeToTallestObject" x="348" y="0" width="55" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{total_haberes}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                    <reportElement uuid="9cbf5a9f-7ccb-4431-88cf-7a64d6ae993e" positionType="Float" stretchType="RelativeToTallestObject" x="403" y="0" width="54" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{total_no_remunerativos}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                    <reportElement uuid="1cb51fa3-c163-40e4-8bac-dfe4e577f054" positionType="Float" stretchType="RelativeToTallestObject" x="513" y="0" width="52" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{total_comprobante}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                    <reportElement uuid="671b85e9-160a-4f7a-9201-eddf5c1f8c42" positionType="Float" stretchType="RelativeToTallestObject" x="457" y="0" width="56" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{total_deducciones}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" pattern="###0;-###0" isBlankWhenNull="true">
                    <reportElement uuid="8e87e678-a6d0-4a8a-861b-087c7f3ddfeb" positionType="Float" stretchType="RelativeToTallestObject" x="265" y="0" width="40" height="20"/>
                    <textElement textAlignment="Right" verticalAlignment="Middle">
                        <font fontName="Verdana" size="7"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{horas}]]></textFieldExpression>
                </textField>
            </elementGroup>
        </band>
    </detail>
    <summary>
        <band height="20">
            <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                <reportElement uuid="426545d8-3084-4a10-bbc1-34edec9cfbf8" positionType="Float" stretchType="RelativeToTallestObject" x="305" y="1" width="43" height="19"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isStrikeThrough="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{Bruto}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                <reportElement uuid="2289c0fa-9727-4cb2-84f5-5af677e41044" positionType="Float" stretchType="RelativeToTallestObject" x="348" y="1" width="55" height="19"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isStrikeThrough="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{Haberes}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                <reportElement uuid="8986551a-e5f1-4903-abba-60271c68071f" positionType="Float" stretchType="RelativeToTallestObject" x="403" y="1" width="54" height="19"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isStrikeThrough="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{NoRem}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                <reportElement uuid="40029f4b-b744-482f-a7ec-86f6968eaad1" positionType="Float" stretchType="RelativeToTallestObject" x="457" y="1" width="56" height="19"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isStrikeThrough="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{Deduc}]]></textFieldExpression>
            </textField>
            <textField isStretchWithOverflow="true" pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
                <reportElement uuid="cc718190-3ab9-470a-8ecb-a6f1814549e0" positionType="Float" stretchType="RelativeToTallestObject" x="513" y="1" width="52" height="19"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isStrikeThrough="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{Neto}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement uuid="3efe1b5f-987e-465f-8e63-456e7751e9d2" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="1" width="305" height="19"/>
                <box>
                    <bottomPen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Right" verticalAlignment="Middle">
                    <font fontName="Verdana" size="7" isBold="true"/>
                </textElement>
                <text><![CDATA[TOTALES:]]></text>
            </staticText>
        </band>
    </summary>
</jasperReport>

我使用以下代码打印报告:

Map parameters = new HashMap();
parameters.put("FECHA_DESDE", listadoSueldos.getFechaDesde());
parameters.put("FECHA_HASTA", listadoSueldos.getFechaHasta());

JasperReport report = JasperCompileManager.compileReport(rutaTemporal + plantillaInforme);
jasperPrint = JasperFillManager.fillReport(report, parameters, conexion);

PrintRequestAttributeSet printRequestAttributeSet = new HashPrintRequestAttributeSet();
printRequestAttributeSet.add(new Copies(numeroCopias));
printRequestAttributeSet.add(OrientationRequested.PORTRAIT);
printRequestAttributeSet.add(MediaSizeName.A4);

PrintServiceAttributeSet printServiceAttributeSet = new HashPrintServiceAttributeSet();

// configuramos el servicio de impresion
JRPrintServiceExporter exporter = new JRPrintServiceExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE, servicios[servicioSeleccionado]);
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_REQUEST_ATTRIBUTE_SET, printRequestAttributeSet);
exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE_ATTRIBUTE_SET, printServiceAttributeSet);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PAGE_DIALOG, Boolean.FALSE);
exporter.setParameter(JRPrintServiceExporterParameter.DISPLAY_PRINT_DIALOG, Boolean.FALSE);

// enviamos la impresion
exporter.exportReport();

我能做些什么?

4

1 回答 1

0

我终于找到了解决方案。

是因为字体 Verdana ttf 与 jdk7 不完全兼容并使用粗体字体,要修复它,我只需将字体更改为 arial,现在一切正常。

于 2013-09-05T22:08:18.303 回答