2014-11-24 49 views
1

我有一個Jasper Reports子報告,它以兩個字段和大約100行的窄表形式呈現。我想要做的是將數據並排顯示爲兩個兩列表 - 一個表上有50行,另一個表上有50行。我不知道如何開始或者事實上如果有可能?任何指導讚賞。跨多列拆分Jasper Reports詳細信息帶

回答

3

在您的報告(根在報告檢查),你會發現部分 「列」改變列的屬性= ,如果它不與值列調整到您的可用頁面的50%大小你也需要更新。您還可以使用打印命令= Horizo​​nal第1列之間的替代方案& 2其他方式您需要調整頁面高度以控制列中有多少個。

<?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="report1" language="groovy" columnCount="2" printOrder="Horizontal" pageWidth="595" pageHeight="842" columnWidth="277" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="858922b0-abde-475c-b53d-12e4f5ecf6d4"> 
    <property name="ireport.zoom" value="1.0"/> 
    <property name="ireport.x" value="0"/> 
    <property name="ireport.y" value="0"/> 
    <queryString> 
     <![CDATA[Select Rownum col1, Rownum col2 
From dual 
Connect By Rownum <= 100]]> 
    </queryString> 
    <field name="COL1" class="java.math.BigDecimal"/> 
    <field name="COL2" class="java.math.BigDecimal"/> 
    <background> 
     <band splitType="Stretch"/> 
    </background> 
    <title> 
     <band height="79" splitType="Stretch"/> 
    </title> 
    <pageHeader> 
     <band height="35" splitType="Stretch"/> 
    </pageHeader> 
    <columnHeader> 
     <band height="20" splitType="Stretch"> 
      <staticText> 
       <reportElement uuid="65057af1-383c-464a-a49e-0c173170cee4" x="74" y="0" width="100" height="20"/> 
       <textElement/> 
       <text><![CDATA[COL1]]></text> 
      </staticText> 
      <staticText> 
       <reportElement uuid="34c22bda-1d12-4699-ae78-4b3785754b1e" x="174" y="0" width="100" height="20"/> 
       <textElement/> 
       <text><![CDATA[COL2]]></text> 
      </staticText> 
     </band> 
    </columnHeader> 
    <detail> 
     <band height="20" splitType="Stretch"> 
      <textField> 
       <reportElement uuid="4dd534f4-5d30-45dc-b9e4-f8752c0f8a9a" x="74" y="0" width="100" height="20"/> 
       <box> 
        <bottomPen lineWidth="0.25"/> 
       </box> 
       <textElement/> 
       <textFieldExpression><![CDATA[$F{COL1}]]></textFieldExpression> 
      </textField> 
      <textField> 
       <reportElement uuid="bef22f4d-1583-4e50-b97f-30a04471e6d4" x="174" y="0" width="100" height="20"/> 
       <box> 
        <bottomPen lineWidth="0.25"/> 
       </box> 
       <textElement/> 
       <textFieldExpression><![CDATA[$F{COL2}]]></textFieldExpression> 
      </textField> 
      <staticText> 
       <reportElement uuid="770d97bb-8266-4647-a6a6-af053f474fb7" x="0" y="0" width="74" height="20"/> 
       <box> 
        <bottomPen lineWidth="0.25"/> 
       </box> 
       <textElement/> 
       <text><![CDATA[row]]></text> 
      </staticText> 
     </band> 
    </detail> 
    <columnFooter> 
     <band height="45" splitType="Stretch"/> 
    </columnFooter> 
    <pageFooter> 
     <band height="54" splitType="Stretch"/> 
    </pageFooter> 
    <summary> 
     <band height="42" splitType="Stretch"/> 
    </summary> 
</jasperReport> 
+0

感謝您給我們!我會在今晚嘗試一下代碼,並讓你知道 – skyman 2014-11-26 21:57:59

+0

非常感謝你!!!!! – Harsha 2016-12-21 20:18:05