2013-09-30 17 views
1

的JasperReports模板與如何忽略模板邊距:利用圖像

leftMargin="100" rightMargin="50" topMargin="50" bottomMargin="50" 

利潤。在這個模板中我有<image>元素。我想將圖像拉伸到整個頁面,忽略頁邊距。

請問,你能幫我找到解決辦法嗎?

<summary> 
    <band splitType="Stretch"> 
     <image isUsingCache="false" onErrorType="Blank"> 
      <reportElement uuid="7569" x="0" y="0"/> 
      <imageExpression><![CDATA[$P{aaa}]]></imageExpression> 
     </image> 
    </band> 
</summary> 
+0

邊距的元素是什麼? –

回答

1

您不能忽略buttom的餘量,但其他的通過使用負數的位置。 (請注意,iReport的不會讓你在設計模式輸入)

<?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="report name" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5c06ba5e-7f96-4b81-bb6a-fcfe8cc2d13f"> 
    <property name="ireport.zoom" value="1.0"/> 
    <property name="ireport.x" value="0"/> 
    <property name="ireport.y" value="10"/> 
    <summary> 
     <band height="802" splitType="Stretch"> 
      <image> 
       <reportElement uuid="a104abd7-bd73-47c4-a4a1-47efeb32d8bf" x="-20" y="-20" width="594" height="822"/> 
       <imageExpression><![CDATA["/home/mor/Desktop/schlachtbeil.jpg"]]></imageExpression> 
      </image> 
     </band> 
    </summary> 
</jasperReport> 

的原因,你不能忽視的bottom保證金是無法展開的band超過pageHeight - (topMargin + bottomMargin)。並且每個元素都不能有一個大於bandHeight - positionheight

0

它看起來像你還沒有很好地定義你的圖像元素。 這是一個你可以得到你想要的東西的例子。

<summary> 
    <band height="471" splitType="Stretch"> 
     <image scaleImage="FillFrame"> 
      <reportElement uuid="45a2de1b-a048-4c65-b5cd-cefabdd39bca" x="0" y="0" width="555" height="471"/> 
      <imageExpression><![CDATA["/path/to/your/image"]]></imageExpression> 
     </image> 
    </band> 
</summary> 

希望它會幫助你。請享用。