jasper-reports - 当左元素为空时将右元素向左移动
问题描述
我将第二个元素USER 2
属性设置Print When Expression
为, 1 == 2
因为我想隐藏第二个元素并将第三个元素USER 3
向左移动,占用第二个元素的空白空间。
现在我得到的结果是第二个元素消失了,但第三个元素会留在原处。当第二个元素为空白时,如何将第三个元素向左移动?
编码:
<?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="KEW.PA-21" pageWidth="1190" pageHeight="842" orientation="Landscape" columnWidth="1150" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isIgnorePagination="true" uuid="a674c8a2-3ac2-47e4-81f5-7a3a99aae035">
<pageHeader>
<band height="123">
<elementGroup>
<elementGroup>
<frame>
<reportElement x="174" y="67" width="174" height="56" uuid="5c273ef2-fc7e-4b93-b696-257f60b2708a">
<printWhenExpression><![CDATA[1 == 2]]></printWhenExpression>
</reportElement>
<box>
<pen lineWidth="0.5"/>
</box>
</frame>
<staticText>
<reportElement x="174" y="67" width="100" height="20" uuid="1f14627b-e41e-41a0-a611-434b982224f4">
<printWhenExpression><![CDATA[1 == 2]]></printWhenExpression>
</reportElement>
<text><![CDATA[USER 2]]></text>
</staticText>
</elementGroup>
</elementGroup>
<elementGroup>
<elementGroup>
<frame>
<reportElement x="0" y="67" width="174" height="56" uuid="4d01df9b-fd94-4093-bcf7-8f1356626842"/>
<box>
<pen lineWidth="0.5"/>
</box>
</frame>
<staticText>
<reportElement x="0" y="67" width="100" height="20" uuid="0d50a57a-d2cf-4e95-80d7-133758e127a1"/>
<text><![CDATA[USER 1]]></text>
</staticText>
</elementGroup>
</elementGroup>
<staticText>
<reportElement x="348" y="67" width="100" height="20" uuid="004d3b77-7652-45f0-ae2e-e3b0f06c1a94"/>
<text><![CDATA[USER 3]]></text>
</staticText>
<frame>
<reportElement x="348" y="67" width="174" height="56" uuid="56942784-51b6-4326-a0db-b6901bb5b565"/>
<box>
<pen lineWidth="0.5"/>
</box>
</frame>
</band>
</pageHeader>
</jasperReport>
解决方案
推荐阅读
- rendering - Cytoscape 中的什么参数决定了边缘渲染的堆叠顺序?
- javascript - yarn start error 不是来自 webpack 的内容是从
- mysql - MySQL Auto_Increment 尝试自动插入先前使用的值
- assembly - TASM 程序挂起
- r - 如何将文本输入存储在向量中,以便稍后与 R Shiny 一起使用?
- python - 通过再次单击按钮来反转 Bokeh 按钮操作
- excel - Excel表格中的列宽
- javascript - 将 Django Rest Framework 中的数据显示到 DropDownPicker React Native 中
- esp32 - 带有arduino的ESP32上的DS18B20 1线温度传感器是否可能存在时序问题?
- javascript - 如何将数组传递给 Firestore?