2010-08-29 14 views
1

我試圖繞過JasperReports,但我似乎理解我從網上獲得的簡單教程。JasperReports創建兩列和兩行

這是我想要的。我想生成一個2列2行報告,其中我將發送jrxml文件中的數據。但我似乎無法超越編譯器。它說element bottom reaches outside band area。我以爲我已經將高度設置爲100和reportelement的高度只有24

<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" pageWidth="612" pageHeight="792" topMargin="0" bottomMargin="0" leftMargin="0" rightMargin="0"> 

    <detail> 
     <band height="100"> 
      <staticText> 
       <reportElement x="0" y="0" width="69" height="24" /> 
       <textElement/> 
       <text> 
        <![CDATA[Column Number 1: ]]> 
       </text> 
      </staticText> 
      <staticText> 
       <reportElement x="140" y="0" width="79" height="24" /> 
       <text> 
        <![CDATA[Column Number 2: ]]> 
       </text> 
      </staticText> 
     </band> 
     <band height="100"> 
      <staticText> 
       <reportElement x="0" y="200" width="69" height="24" /> 
       <textElement/> 
       <text> 
        <![CDATA[Column Number 3: ]]> 
       </text> 
      </staticText> 
      <staticText> 
       <reportElement x="140" y="200" width="79" height="24" /> 
       <text> 
        <![CDATA[Column Number 4: ]]> 
       </text> 
      </staticText> 
     </band> 
    </detail> 
</jasperReport> 

我不知道是不是算違法有兩個帶標籤的一個細節標籤?

回答

1

我建議下載iReport並用它來建立你的報告。

這是一個設計碧玉報告的全功能應用程序。

如果你實際上打開了你現有的jrxml文件,它應該以紅色突出顯示你的樂隊出界。

編輯:

你所得到的錯誤的原因是在碧玉報告中的X和Y座標是相對於帶不是頁面。所以200的價值將它放在樂隊之外。

如果您使用的是第一個樂隊使用的相同值,它應該可以正常工作,例如,

<reportElement x="0" y="0" width="69" height="24" />兩者。

+0

謝謝。我會研究這個工具。 – 2010-09-01 05:23:37

+0

@Mark Estrada很高興爲您提供幫助。請看詳細的答案。它應該澄清你的問題。 – Gordon 2010-09-01 08:37:28

0

或jasperAssisstant,如果您使用的是Eclipse。它們是Jasper Design的完美工具,否則,直接在jrxml上修改,記住所有標籤,非常乏味。