我想在数据为空时删除列表组件空间,我已经尝试过(当空白时删除行)选项但是没有用,它打印带有列表组件高度的空间。 感谢帮助。
var url = "http://ec.europa.eu/budg/inforeuro/api/public/monthly-rates"
$.ajax({
crossOrigin: true,
type: "GET",
crossDomain: true,
async: false,
url: url,
dataType: 'jsonp',
jsonpCallback: 'jsonCallback',
contentType: "application/json",
success: function (data) {
console.log("Success");
},
error: function () {
console.log("Ajax Error Occurred");
}
});
答案 0 :(得分:0)
尝试在list
组件中包含所有Frame
个组件,并为isRemoveLineWhenBlank
rue
启用所有组件,包括Frame
组件。以下只是一个示例
<detail>
<band height="125" splitType="Stretch">
<frame>
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="124" y="114" width="393" height="17" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="69f3030b-5ff6-4689-aa2f-d929dc017fc4"/>
<componentElement>
<reportElement x="5" y="13" width="797" height="88" uuid="d03a66cd-2364-4705-b9c1-7ccdc1f03542"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="dataset1" uuid="55af5621-ba24-4f19-8c1d-496627ce93c6">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(1)]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="88" width="797">
<staticText>
<reportElement x="22" y="0" width="100" height="20" uuid="3a8c6a5e-2337-40b6-9464-984655b240c1"/>
<text><![CDATA[Parent List]]></text>
</staticText>
<staticText>
<reportElement x="186" y="0" width="100" height="20" uuid="3961e703-a32a-4c98-98fc-5b5fd745962a"/>
<text><![CDATA[Parent List]]></text>
</staticText>
<staticText>
<reportElement x="350" y="0" width="100" height="20" uuid="c75ef0b2-9d7b-4d53-89a9-60407300b1f5"/>
<text><![CDATA[Parent List]]></text>
</staticText>
<componentElement>
<reportElement x="0" y="20" width="797" height="26" uuid="3a0c69f8-788d-4e30-b9ab-3a5a7e6847b2"/>
<jr:list>
<datasetRun subDataset="dataset2" uuid="109058e7-c925-4ab2-ae35-4d71a8868623">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource(1)]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="26" width="797">
<staticText>
<reportElement x="20" y="4" width="100" height="20" uuid="528cdfee-2066-4c73-bfa4-01c71368e999"/>
<text><![CDATA[child List]]></text>
</staticText>
<staticText>
<reportElement x="190" y="4" width="100" height="20" uuid="3187542d-7f8d-4770-9d84-0a0a5ee2c841"/>
<text><![CDATA[Child List]]></text>
</staticText>
</jr:listContents>
</jr:list>
</componentElement>
<staticText>
<reportElement x="24" y="52" width="100" height="20" uuid="83d4dfff-8142-4e20-a929-e37a23ea2c20"/>
<text><![CDATA[Total]]></text>
</staticText>
</jr:listContents>
</jr:list>
</componentElement>
</frame>
</band>
</detail>
希望这可以帮助你。