Gapless alignment of elements in detail bands

Hello everyone,

 

I've been struggling with the gapless alignment of 5 text fields in 2 detail bands for a few days now. I hope you can help me.

 

Several selected items can be seen in the screenshot "Template design".


In the detail band 1 on the left side there are 2 text fields, which are filled from the subdataset 'ProductDescription'. A heading (identifier) ​​and a description text value (value) that can be of different lengths.

On the right side of Detail Band 1 there are 2 text fields (identifier/value) which are filled from the subDataset 'AttributeGroup1', which can contain a different number of rows.

In detail band 2 on the right side there are 2 text fields (identifier/value), which are filled from the subDataset 'AttributeGroup2', which can contain different numbers of rows.

See attachement: "Template design"

Field definitions:

    <subDataset name="Dataset1" uuid="a9414a48-3923-4caa-9361-092eb7a5dc26">
        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
        <queryString>
            <![CDATA[]]>
        </queryString>
        <field name="identifier" class="java.lang.String"/>
        <field name="value" class="java.lang.String"/>
        <field name="description" class="java.lang.String"/>
    </subDataset>

    <queryString>
        <![CDATA[]]>
    </queryString>
    <field name="Header" class="java.lang.String"/>
    <field name="ArticleNo" class="java.lang.String"/>
    <field name="ProductName" class="java.lang.String">
        <fieldDescription><![CDATA[]]></fieldDescription>
    </field>
    <field name="MainAssetUrl" class="java.lang.String"/>
    <field name="BesideAssetUrls" class="net.sf.jasperreports.engine.JRDataSource"/>
    <field name="GeneralAttributesHeader" class="java.lang.String"/>
    <field name="GeneralAttributesColumn1" class="net.sf.jasperreports.engine.JRDataSource"/>
    <field name="GeneralAttributesColumn2" class="net.sf.jasperreports.engine.JRDataSource"/>
    <field name="ProductDescription" class="net.sf.jasperreports.engine.JRDataSource"/>
    <field name="AttributeGroupHeader1" class="java.lang.String"/>
    <field name="AttributeGroup1" class="net.sf.jasperreports.engine.JRDataSource"/>
    <field name="AttributeGroupHeader2" class="java.lang.String"/>
    <field name="AttributeGroup2" class="net.sf.jasperreports.engine.JRDataSource"/>
    <field name="AttributeGroupHeader3" class="java.lang.String"/>

 

To the problem:


Depending on the length of the text on the left, there is an unwanted gap between the elements on the right.

See attachement: "Print without gap"

I'm trying to force gapless alignment of text elements on the right, regardless of text length on the left

Like so:

Does anyone know how to solve the problem?

ansgar.tingelhoff's picture
Joined: Jun 22 2022 - 11:55pm
Last seen: 1 month 3 weeks ago

1 Answer:

<span style="font-size:14px">I solved my own problem a little later by putting the subdataset 'ProductDescription', 'AttributeGroup1' and 'AttributeGroup2' in Detail Band 1 and putting 'AttributeGroup2' in a frame. For the frame I had to enable Position Type 'Float'.</span>
ansgar.tingelhoff's picture
Joined: Jun 22 2022 - 11:55pm
Last seen: 1 month 3 weeks ago
Feedback
randomness