从 IReport 3.0 迁移到 Jaspersotf studio 6.18.1 的问题

Problems migrating from IReport 3.0 to Jaspersotf studio 6.18.1

我正在 Jaspersoft Studio 6.18.1 中执行在 IReport 3.0 中创建的报告,我进行了几次迁移,但这对我来说有点复杂,在 IReport 3.0 中执行它时它在 Jaspersoft Studio 中工作正常它不会,但是有时报告会出现在我面前,当我复制更改时它也不会生效,例如:(以下指令在查询的位置)

TRIM(IIM.IFII) LIKE CASE WHEN '$P!{SIZE}' = ' ' THEN '%' ELSE '$P!{SIZE}' END

将 $P!{SIZE} 更改为 ' ' 有时会向我显示查询,但随后我重试,它不再显示了。 这不是 sql 问题,它也不显示错误,只显示空文档,如果有人知道这是什么原因,我感谢您提前回复。

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.18.1.final using JasperReports Library version 6.18.1-9d75d1969e774d4f179fb3be8401e98a0e6d1611  -->
<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="Re040FE" pageWidth="955" pageHeight="612" orientation="Landscape" whenNoDataType="NoPages" columnWidth="895" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" uuid="284b012e-355b-4301-ad46-3ed5c6840aea">
    <property name="ireport.scriptlethandling" value="0"/>
    <property name="ireport.encoding" value="UTF-8"/>
    <import value="net.sf.jasperreports.engine.*"/>
    <import value="java.util.*"/>
    <import value="net.sf.jasperreports.engine.data.*"/>
    <parameter name="AMB" class="java.lang.String"/>
    <parameter name="BOD" class="java.lang.String"/>
    <parameter name="INS" class="java.lang.String"/>
    <parameter name="NOM" class="java.lang.String"/>
    <parameter name="TAM" class="java.lang.String"/>
    <parameter name="CODI" class="java.lang.String"/>
    <parameter name="CODF" class="java.lang.String"/>
    <parameter name="LOC" class="java.lang.String"/>
    <parameter name="LOT" class="java.lang.String"/>
    <parameter name="FLIB" class="java.lang.String"/>
    <parameter name="VENCE" class="java.lang.String"/>
    <parameter name="EST" class="java.lang.String"/>
    <parameter name="SINFV" class="java.lang.String"/>
    <queryString>
        <![CDATA[SELECT IWM.WMFAC,
       ILI.LPROD,
       TRIM(IIM.IDESC) || ' ' || IIM.IDSCE AS DESC_PRD,
       IIM.IUMS,
       ILI.LWHS,
       ILI.LLOC,
       ILI.LLOT,
       CASE WHEN (ILI.LWHS LIKE 'N%' OR ILI.LWHS LIKE 'M%') AND (ILI.LWHS NOT IN ('M51', 'M04')) THEN ILN.LMRB ELSE ILI.LISTAT END AS LISTAT,
       ILI.LOPB + ILI.LRCT + ILI.LADJU - ILI.LISSU AS INV, 
       (ILI.LIALOC - COALESCE(ELA.CANT_ASIG,0)) AS INVT, 
       ILI.LOPB + ILI.LRCT + ILI.LADJU - ILI.LISSU - ILI.LIALOC AS INVD,
       IIM.IFII,
       IWM.LDESC,
       ZMF.MFDESC,
       ILN.LEXDT AS VEN,
       ILN.LQAAP AS CAL,
       TRIM(ILN.LNMLOT) AS LMAN,
       CASE WHEN ILI.LIWOPB + ILI.LIWRPT + ILI.LIWADJ - ILI.LIWISS < 0 THEN 0 ELSE ILI.LIWOPB + ILI.LIWRPT + ILI.LIWADJ - ILI.LIWISS END AS PESO,
       (ILI.LIALOC - COALESCE(ELA.CANT_TRANS,0)) AS INVA,
       (ILI.LOPB + ILI.LRCT + ILI.LADJU - ILI.LISSU - (ILI.LIALOC - COALESCE(ELA.CANT_ASIG,0))) AS INVTC
FROM $P!{AMB}.ILI AS ILI
   JOIN $P!{AMB}.IIM AS IIM ON ILI.LPROD = IIM.IPROD
   JOIN $P!{AMB}.IWM AS IWM ON ILI.LWHS = IWM.LWHS
   JOIN $P!{AMB}.ZMF AS ZMF ON IWM.WMFAC = ZMF.MFFACL
   LEFT OUTER JOIN $P!{AMB}.ILN AS ILN ON ILI.LPROD = ILN.LPROD 
                                      AND ILI.LLOT = ILN.LLOT
  LEFT OUTER JOIN (SELECT ELA.APROD,
                            ELA.ALOT,
                            ELA.AWHS,
                            ELA.ALOC,
                            SUM(CASE WHEN ELA.ATYPE = 'S' THEN ELA.LQALL
                                     WHEN  ECH.CHSTS1 || ECH.CHSTS2 || ECH.CHSTS3 || ECH.CHSTS4 || ECH.CHSTS5 = '10000' THEN ELA.LQALL
                                     ELSE 0 END) AS CANT_ASIG,
                            SUM(CASE WHEN ELA.ATYPE = 'S' THEN 0
                                     WHEN  ECH.CHSTS1 || ECH.CHSTS2 || ECH.CHSTS3 || ECH.CHSTS4 || ECH.CHSTS5 <> '10000' THEN ELA.LQALL
                                  ELSE 0 END) AS CANT_TRANS
                     FROM $P!{AMB}.ELA ELA
                      JOIN $P!{AMB}.ECH ECH ON ELA.AORD = ECH.HORD
                     WHERE ELA.AWHS LIKE UCASE('$P!{BOD}%')
                     GROUP BY ELA.APROD,
                              ELA.ALOT,
                              ELA.AWHS,
                              ELA.ALOC) AS ELA ON ELA.APROD = ILI.LPROD AND ELA.ALOT = ILI.LLOT AND ELA.AWHS = ILI.LWHS AND ILI.LLOC = ELA.ALOC
WHERE (ILI.LOPB + ILI.LRCT + ILI.LADJU - ILI.LISSU <> 0)
   AND ILI.LWHS LIKE ucase('$P!{BOD}%')
   AND TRIM(IIM.IFII) LIKE  CASE WHEN '$P!{TAM}' = '' THEN '%' ELSE '$P!{TAM}' END 
   AND IIM.IDESC LIKE ucase('%$P!{NOM}%')
   AND  ILI.LPROD >= '$P!{CODI}' 
   AND ILI.LPROD <= CASE WHEN '$P!{CODF}' = '' THEN '999999999999999999' ELSE '$P!{CODF}' END 
   AND ILI.LLOC LIKE UCASE('$P!{LOC}%') AND (ILI.LLOT LIKE UCASE('$P!{LOT}%') )
   AND (iln.LQAAP is null OR (
                              (iln.LQAAP >= CASE WHEN '$P!{FLIB}' = '' THEN 0 ELSE '$P!{FLIB}' END)
                              AND
                              (iln.LEXDT <= CASE WHEN '$P!{VENCE}' = '' THEN 99999999 ELSE '$P!{VENCE}' END)   
                             )
       ) 
   AND (
        '$P!{EST}' = '' 
        OR
        iln.LMRB = '$P!{EST}'
       )
    AND (
        '$P!{SINFV}' = '' 
        OR
        '$P!{SINFV}' = 'N' 
        OR
        iln.LEXDT = CASE WHEN '$P!{SINFV}' = 'S' THEN '99999999' ELSE '0' END
       )
ORDER BY IWM.WMFAC,
         ILI.LWHS,
         IIM.IFII,
         ILI.LPROD,
         TRIM(iln.LNMLOT),
         ILI.LISTAT]]>
    </queryString>
    <field name="WMFAC" class="java.lang.String"/>
    <field name="LPROD" class="java.lang.String"/>
    <field name="DESC_PRD" class="java.lang.String"/>
    <field name="IUMS" class="java.lang.String"/>
    <field name="LWHS" class="java.lang.String"/>
    <field name="LLOC" class="java.lang.String"/>
    <field name="LLOT" class="java.lang.String"/>
    <field name="LISTAT" class="java.lang.String"/>
    <field name="INV" class="java.math.BigDecimal"/>
    <field name="IFII" class="java.lang.String"/>
    <field name="LDESC" class="java.lang.String"/>
    <field name="MFDESC" class="java.lang.String"/>
    <field name="VEN" class="java.math.BigDecimal"/>
    <field name="CAL" class="java.math.BigDecimal"/>
    <field name="LMAN" class="java.lang.String"/>
    <field name="PESO" class="java.math.BigDecimal"/>
    <field name="INVT" class="java.math.BigDecimal"/>
    <field name="INVD" class="java.math.BigDecimal"/>
    <field name="INVA" class="java.math.BigDecimal"/>
    <field name="INVTC" class="java.math.BigDecimal"/>
    <variable name="TOT_COD" class="java.math.BigDecimal" resetType="Group" resetGroup="COD" calculation="Sum">
        <variableExpression><![CDATA[$F{INV}]]></variableExpression>
    </variable>
    <variable name="TOT_TAM" class="java.math.BigDecimal" resetType="Group" resetGroup="TAM" calculation="Sum">
        <variableExpression><![CDATA[$F{INV}]]></variableExpression>
    </variable>
    <variable name="TOT_BOD" class="java.math.BigDecimal" resetType="Group" resetGroup="BOD" calculation="Sum">
        <variableExpression><![CDATA[$F{INV}]]></variableExpression>
    </variable>
    <variable name="TOT_COD_PESO" class="java.math.BigDecimal" resetType="Group" resetGroup="COD" calculation="Sum">
        <variableExpression><![CDATA[$F{PESO}]]></variableExpression>
    </variable>
    <variable name="TOT_TAMT" class="java.math.BigDecimal" resetType="Group" resetGroup="TAM" calculation="Sum">
        <variableExpression><![CDATA[$F{INVT}]]></variableExpression>
    </variable>
    <variable name="TOT_TAMD" class="java.math.BigDecimal" resetType="Group" resetGroup="TAM" calculation="Sum">
        <variableExpression><![CDATA[$F{INVD}]]></variableExpression>
    </variable>
    <variable name="TOT_CODT" class="java.math.BigDecimal" resetType="Group" resetGroup="COD" calculation="Sum">
        <variableExpression><![CDATA[$F{INVT}]]></variableExpression>
    </variable>
    <variable name="TOT_CODD" class="java.math.BigDecimal" resetType="Group" resetGroup="COD" calculation="Sum">
        <variableExpression><![CDATA[$F{INVD}]]></variableExpression>
    </variable>
    <variable name="TOT_COD_A" class="java.math.BigDecimal" resetType="Group" resetGroup="COD" calculation="Sum">
        <variableExpression><![CDATA[$F{INVA}]]></variableExpression>
    </variable>
    <variable name="TOT_COD_TC" class="java.math.BigDecimal" resetType="Group" resetGroup="COD" calculation="Sum">
        <variableExpression><![CDATA[$F{INVTC}]]></variableExpression>
    </variable>
    <variable name="TOT_TAM_A" class="java.math.BigDecimal" resetType="Group" resetGroup="TAM" calculation="Sum">
        <variableExpression><![CDATA[$F{INVA}]]></variableExpression>
    </variable>
    <variable name="TOT_TAM_TC" class="java.math.BigDecimal" resetType="Group" resetGroup="TAM" calculation="Sum">
        <variableExpression><![CDATA[$F{INVTC}]]></variableExpression>
    </variable>
    <group name="INS" isReprintHeaderOnEachPage="true">
        <groupExpression><![CDATA[$F{WMFAC}]]></groupExpression>
        <groupHeader>
            <band height="26" splitType="Stretch">
                <rectangle>
                    <reportElement key="rectangle-1" x="1" y="2" width="893" height="18" forecolor="#999999" backcolor="#CCCCCC" uuid="5971d597-ff09-4849-9664-bbe9eb9ba5ec"/>
                </rectangle>
                <textField isBlankWhenNull="false">
                    <reportElement key="textField" x="8" y="3" width="25" height="16" uuid="e92f1ccd-225a-40d1-b553-e6d0e5c6f0a1"/>
                    <textElement verticalAlignment="Middle">
                        <font size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{WMFAC}]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="false">
                    <reportElement key="textField-5" x="36" y="3" width="259" height="16" uuid="cc567073-a2cc-4852-a887-02abf5b04b87"/>
                    <textElement verticalAlignment="Middle">
                        <font size="10" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{MFDESC}.toUpperCase()]]></textFieldExpression>
                </textField>
            </band>
        </groupHeader>
        <groupFooter>
            <band height="18" splitType="Stretch"/>
        </groupFooter>
    </group>
    
    <group name="TAM" isReprintHeaderOnEachPage="true">
        <groupExpression><![CDATA[$F{IFII}]]></groupExpression>
        <groupHeader>
            <band height="14" splitType="Stretch">
                <rectangle>
                    <reportElement key="rectangle-2" x="1" y="0" width="546" height="12" forecolor="#CCCCCC" uuid="a602dfdc-12a8-463d-9879-80d4dd77f34f">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                </rectangle>
                <textField isBlankWhenNull="false">
                    <reportElement key="textField" x="25" y="0" width="215" height="13" uuid="306d661f-055a-436d-ba14-aa832511417c"/>
                    <textElement>
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{IFII}.trim().equals("") ? "" : "TAMAÑO " + $F{IFII}]]></textFieldExpression>
                </textField>
            </band>
        </groupHeader>
        <groupFooter>
            <band height="22" splitType="Stretch">
                <rectangle>
                    <reportElement key="rectangle-3" x="166" y="3" width="381" height="12" forecolor="#CCCCCC" uuid="91467346-c518-418a-9649-c28f5ca89dd1">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                </rectangle>
                <textField isBlankWhenNull="false">
                    <reportElement key="textField-6" x="167" y="3" width="100" height="13" uuid="84a7caa3-fa24-4156-993e-db5b5d5633fc"/>
                    <textElement textAlignment="Right">
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{IFII}.trim().equals("") ? "" : "TOTAL TAMAÑO " + $F{IFII}]]></textFieldExpression>
                </textField>
                <textField pattern="#,##0.000" isBlankWhenNull="false">
                    <reportElement key="textField-7" x="594" y="2" width="57" height="13" uuid="eb4884cb-5f5d-4410-b8f8-cb1ce18a440d">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                    <textElement textAlignment="Right">
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{TOT_TAMD}]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="false">
                    <reportElement key="textField-9" x="660" y="2" width="42" height="13" uuid="5649bf74-9344-40b8-a3d5-33108c0e5e6a">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                    <textElement textAlignment="Center">
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$F{IUMS}]]></textFieldExpression>
                </textField>
                <textField pattern="#,##0.000" isBlankWhenNull="false">
                    <reportElement key="textField-27" x="533" y="2" width="57" height="13" uuid="48103168-496e-4701-8a26-1d8f08487532">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                    <textElement textAlignment="Right">
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{TOT_TAMT}]]></textFieldExpression>
                </textField>
                <textField pattern="#,##0.000" isBlankWhenNull="false">
                    <reportElement key="textField-28" x="350" y="2" width="57" height="13" uuid="ed4ec826-e26d-4e3d-b61d-89579b1c1ce8">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                    <textElement textAlignment="Right">
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{TOT_TAM}]]></textFieldExpression>
                </textField>
                <textField pattern="#,##0.000" isBlankWhenNull="false">
                    <reportElement key="textField-32" x="411" y="2" width="57" height="13" uuid="efa54091-21ff-4260-880d-44ed6df999fe">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                    <textElement textAlignment="Right">
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{TOT_TAM}]]></textFieldExpression>
                </textField>
                <textField pattern="#,##0.000" isBlankWhenNull="false">
                    <reportElement key="textField-33" x="472" y="2" width="57" height="13" uuid="ed5c9563-e1f0-4030-a302-f28707c77396">
                        <printWhenExpression><![CDATA[new Boolean(!$F{IFII}.trim().equals("") )]]></printWhenExpression>
                    </reportElement>
                    <textElement textAlignment="Right">
                        <font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
                    </textElement>
                    <textFieldExpression><![CDATA[$V{TOT_TAM_TC}]]></textFieldExpression>
                </textField>
            </band>
        </groupFooter>
    </group>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="34" splitType="Stretch">
            <staticText>
                <reportElement key="staticText-1" x="1" y="0" width="893" height="19" uuid="4cf54817-5094-44aa-95af-0887883abc4e"/>
                <textElement textAlignment="Center">
                    <font size="12" isBold="true" pdfFontName="Helvetica-Bold"/>
                </textElement>
                <text><![CDATA[REPORTE DE INVENTARIO]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band height="1" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="13" splitType="Stretch">
            <textField isBlankWhenNull="false">
                <reportElement key="textField" x="76" y="0" width="68" height="13" uuid="f77eb419-da24-4f68-981a-395d649d0f17"/>
                <textElement>
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{LLOC}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement key="textField" x="135" y="0" width="214" height="13" uuid="79a474ea-f73a-4066-b20e-4e4f1920f441"/>
                <textElement>
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{LLOT}.trim() +  (  $F{LMAN} == null ? "" :     ( $F{LMAN}.equals("") ? "" : "  /  " + $F{LMAN}     )

)]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement key="textField" x="274" y="0" width="28" height="13" uuid="d02bae3e-0197-4487-9bc3-fbae2983369d"/>
                <textElement>
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{LISTAT}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.000" isBlankWhenNull="false">
                <reportElement key="textField" x="350" y="0" width="57" height="13" uuid="8f8326d8-a6b4-4fbe-a67a-9b43fbbe3794"/>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{INV}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="false">
                <reportElement key="textField" x="659" y="0" width="43" height="13" uuid="7bb47536-b6aa-4c01-a06d-9b82303104f2"/>
                <textElement textAlignment="Center">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{IUMS}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="false">
                <reportElement key="textField-1" x="42" y="0" width="34" height="13" uuid="ecaa6379-ca75-4124-b81b-e56f6380644f"/>
                <textElement>
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{LWHS}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00" isBlankWhenNull="true">
                <reportElement key="textField-10" x="839" y="0" width="56" height="13" uuid="776d859a-7d64-4e4b-a52c-ee3782424991"/>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{VEN}.toString().equals("0") || $F{VEN}.toString().equals("99999999") ? "" : $F{VEN}.toString().substring(0, 4).concat("/").concat($F{VEN}.toString().substring(4, 6).concat("/").concat($F{VEN}.toString().substring(6, 8)))]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.00" isBlankWhenNull="true">
                <reportElement key="textField-14" x="780" y="0" width="56" height="13" uuid="8abe232b-07f3-4fd8-bdd7-b8f2d952e6c5"/>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{CAL}.toString().equals("0") || $F{CAL}.toString().equals("99999999") ? "" : $F{CAL}.toString().substring(0, 4).concat("/").concat($F{CAL}.toString().substring(4, 6).concat("/").concat($F{CAL}.toString().substring(6, 8)))]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.0000" isBlankWhenNull="false">
                <reportElement key="textField" x="706" y="0" width="52" height="13" uuid="c081d6e3-af0b-4501-9218-31b2afef6431">
                    <printWhenExpression><![CDATA[new Boolean($F{PESO}.doubleValue() > 0)]]></printWhenExpression>
                </reportElement>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{PESO}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="false">
                <reportElement key="textField-16" x="759" y="0" width="17" height="13" uuid="228f63df-4ce3-4977-a3ae-d71a2c86f424">
                    <printWhenExpression><![CDATA[new Boolean($F{PESO}.doubleValue() > 0)]]></printWhenExpression>
                </reportElement>
                <textElement textAlignment="Left">
                    <font size="8" isBold="false" pdfFontName="Helvetica"/>
                </textElement>
                <textFieldExpression><![CDATA["KG"]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.000" isBlankWhenNull="false" hyperlinkType="Reference" bookmarkLevel="1">
                <reportElement key="textField-21" x="533" y="0" width="57" height="13" uuid="ed560b89-febc-4bdb-abf7-244231940fb8"/>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{INVT}]]></textFieldExpression>
                <anchorNameExpression><![CDATA["DETALLE"]]></anchorNameExpression>
                <hyperlinkReferenceExpression><![CDATA["http://miportal:9010/MiPortal/pop.faces?AMB=" + $P{AMB}.trim() + "&PRODUCTO=" + $F{LPROD}.trim()  + "&BODEGA=" + $F{LWHS}.trim()  + "&UBICACION=" + $F{LLOC}.trim()+ "&OBJETO=RE040D"]]></hyperlinkReferenceExpression>
            </textField>
            <textField pattern="#,##0.000" isBlankWhenNull="false">
                <reportElement key="textField-24" x="594" y="0" width="57" height="13" uuid="7905fa9e-94a4-40e6-b0e7-7a9b911c4b9f"/>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{INVD}]]></textFieldExpression>
            </textField>
            <textField pattern="#,##0.000" isBlankWhenNull="false" hyperlinkType="Reference" bookmarkLevel="1">
                <reportElement key="textField-30" x="411" y="0" width="57" height="13" uuid="b97d521a-e210-4f00-97c9-27c101fc9e70"/>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{INVA}]]></textFieldExpression>
                <anchorNameExpression><![CDATA["Detalle"]]></anchorNameExpression>
                <hyperlinkReferenceExpression><![CDATA["http://miportal:9010/MiPortal/pop.faces?AMB=" + $P{AMB}.trim() + "&PRODUCTO=" + $F{LPROD}.trim()  + "&BODEGA=" + $F{LWHS}.trim()  + "&UBICACION=" + $F{LLOC}.trim()+ "&OBJETO=RE040D"]]></hyperlinkReferenceExpression>
            </textField>
            <textField pattern="#,##0.000" isBlankWhenNull="false" hyperlinkType="Reference">
                <reportElement key="textField-34" x="472" y="0" width="57" height="13" uuid="e12bbab2-26f8-4ade-be10-dc476789c9d6"/>
                <textElement textAlignment="Right">
                    <font size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{INVTC}]]></textFieldExpression>
                <anchorNameExpression><![CDATA["Detalle"]]></anchorNameExpression>
                <hyperlinkReferenceExpression><![CDATA["http://miportal:9010/MiPortal/pop.faces?AMB=" + $P{AMB}.trim() + "&PRODUCTO=" + $F{LPROD}.trim()  + "&BODEGA=" + $F{LWHS}.trim()  + "&UBICACION=" + $F{LLOC}.trim()+ "&OBJETO=RE040D"]]></hyperlinkReferenceExpression>
            </textField>
        </band>
    </detail>
</jasperReport>

IReport版本做CASE WHEN...可以直接放:

ILI.LPROD <= CASE WHEN '$P!{CODF}' = '' 
                      THEN '999999999999999999' 
                      ELSE '$P!{CODF}' END 

在 Jaspersotf studio 6.18.1 版本中与 ' ' 比较时,它的值 returns 不是空的,而是 null,这就是为什么在启动查询时它返回空白文档,而不是放置必须放置比较时的' ':

ILI.LPROD <= CASE WHEN '$P!{CODF}' = 'null' 
                      THEN '9999999999999' 
                      ELSE '$P!{CODF}' END

这解决了我的问题