Question

I have been playing with DynamicJasper lately, and have been pretty impressed. The only issue I have is that some of the reports I create are more like printed forms, where you would have the label (which is technically the column header) to the left of the data field. When drawing the report in iReport this is not an issue. You would just place them in the detail section next to the field.

It would look:

Sample Design

The jrxml would be:

<detail>
        <band height="125" splitType="Stretch">
            <textField>
                <reportElement x="56" y="0" width="76" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{Column 1}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="0" y="0" width="56" height="20"/>
                <textElement/>
                <text><![CDATA[Column 1:]]></text>
            </staticText>
            <textField>
                <reportElement x="189" y="0" width="71" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{Column 2}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="132" y="0" width="57" height="20"/>
                <textElement/>
                <text><![CDATA[Column 2:]]></text>
            </staticText>
            <textField>
                <reportElement x="318" y="0" width="73" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{Column 3}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="260" y="0" width="58" height="20"/>
                <textElement/>
                <text><![CDATA[Column 3:    ]]></text>
            </staticText>
            <textField>
                <reportElement x="451" y="0" width="100" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{Column 4}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="391" y="0" width="60" height="20"/>
                <textElement/>
                <text><![CDATA[Column 4]]></text>
            </staticText>
        </band>
    </detail>

Any idea how to pull this off with just Dynamic Jasper?

Was it helpful?

Solution

this is not doable currently in DynamicJasper. A new LayoutManager implementation would be needed.

Dj aims to resovle column based reports only.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top