Hi,

I really hope someone has a clue on this layout issue, because I am already
out of ideas.

Although I think that my problem has something to do with the designs i.e.
with way Jasper treats them (layout), here's some general information abou
the application.

Basically we have a JAVA client-server application and we use Jasper to
generate a bunch of reports. The Jasper designs are processed by a servlet
on the server-side and sent to the client as jrprint files, where they are
being presented to the user. We also have a scriptlet that does some stuff -
concatenating data etc.

The report that I am having trouble with has the following structure shown
in code snippet #1

The data for it comes from a SQL query that works perfectly, so it's only
the layout that is bugging me.

In the detail I have a bunch of textfields that visualise some hierarchy and
another textfield that can contain relatively large amount of text. I've
packed each of them in a frame, both of them building up another frame.

Beneath them I have another frame which can contain 0,1 or 2 images
(ideally). I end up with a report containing pages like the one in
attachment 1.

My goal is to have report pages where there is no space between the above
frame and the image frame - like the one in attachment 2, and of course with
the text within the upper frame. At the moment this is only possible if I
get rid of the lengthy text.

In my opinion, the problem lies in the definition of the field for the
lengthy text. As I don't know how long the string would be, i define it with
a height of 13 (code snippet #2 ), that is one line only. Because of the
stretching properties of the fields it accommodates accordingly, but by
doing so it pushes the images down by variable number of lines. So, is there
any way to avoid that "pushing", which ruins the design.

Any help will be deeply appreciated. Thanks for it in advance.

Regards, al

----- code #1

<band height="245" isSplitAllowed="false"><!-- 245 -->
  <frame>
    <reportElement isRemoveLineWhenBlank="true"
      positionType="Float" width="545" y="0" x="0" height="75"
      stretchType="RelativeToBandHeight">
    </reportElement>

    <box>
      <pen lineColor="black" lineStyle="Solid"
        lineWidth="1" />
    </box>

    <frame>
      <reportElement isRemoveLineWhenBlank="true"
        positionType="FixRelativeToTop" width="200" y="0" x="55"
        height="75" stretchType="RelativeToTallestObject"/>

      <box>
        <pen lineColor="green" lineStyle="Solid"
          lineWidth="3" />
      </box>

      <textField isStretchWithOverflow="true" pattern=""
        isBlankWhenNull="true" evaluationGroup="Ebene2">
        <reportElement x="0" y="0" width="200"
          height="13" positionType="Float" isRemoveLineWhenBlank="true"
          isPrintInFirstWholeBand="true">
          <printWhenExpression><![CDATA[new Boolean( 
($F{AnlagenEbeneOfSchaden}).intValue()==1 )]]></printWhenExpression>
        </reportElement>

        <textElement>
          
        </textElement>
        <textFieldExpression
class="java.lang.String"><![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
1)]]></textFieldExpression>
      </textField>

      <textField isStretchWithOverflow="true" pattern=""
        isBlankWhenNull="true" evaluationGroup="Ebene2">
        <reportElement x="15" y="0" width="185"
          height="13" mode="Opaque" positionType="Float"
          isRemoveLineWhenBlank="true" isPrintInFirstWholeBand="true" />
        <textElement>
          
        </textElement>
        <textFieldExpression
class="java.lang.String"><![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
2)]]></textFieldExpression>
      </textField>
      <textField isStretchWithOverflow="true" pattern=""
        isBlankWhenNull="true" evaluationGroup="Ebene3">
        <reportElement mode="Opaque" x="30" y="15"
          width="170" height="13" positionType="Float"
          isRemoveLineWhenBlank="true" />
        <textElement>
          
        </textElement>
        <textFieldExpression
class="java.lang.String"><![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
3)]]></textFieldExpression>
      </textField>

      <textField isStretchWithOverflow="true" pattern=""
        isBlankWhenNull="true">
        <reportElement mode="Opaque" x="45" y="30"
          width="155" height="13" positionType="Float"
          isRemoveLineWhenBlank="true" />
        <textElement>
          
        </textElement>
        <textFieldExpression
class="java.lang.String"><![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
4)]]></textFieldExpression>
      </textField>
      <textField isStretchWithOverflow="true" pattern=""
        isBlankWhenNull="true">
        <reportElement mode="Opaque" x="60" y="45"
          width="140" height="13" positionType="Float"
          isRemoveLineWhenBlank="true" />
        <textElement>
          
        </textElement>
        <textFieldExpression
class="java.lang.String"><![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
5)]]></textFieldExpression>
      </textField>
      <textField isStretchWithOverflow="true" pattern=""
        isBlankWhenNull="true">
        <reportElement mode="Opaque" x="75" y="60"
          width="125" height="13" positionType="Float"
          isRemoveLineWhenBlank="true" />
        <textElement>
          
        </textElement>
        <textFieldExpression
class="java.lang.String"><![CDATA[((alwin2Scriptlet)$P{REPORT_SCRIPTLET}).getStrukturBezMitStandOrtEbeneDB($F{Strukturcode1},
6)]]></textFieldExpression>
      </textField>
    </frame>

    <textField isStretchWithOverflow="true" pattern=""
      isBlankWhenNull="true">
      <reportElement mode="Opaque" x="30" y="1" width="20"
        height="13" isRemoveLineWhenBlank="true" />
      <textElement>
        
      </textElement>
      <textFieldExpression
class="java.lang.Integer"><![CDATA[$V{REPORT_COUNT}]]></textFieldExpression>
    </textField>
    <textField isStretchWithOverflow="true" pattern=""
      isBlankWhenNull="true">
      <reportElement mode="Opaque" x="515" y="1"
        width="20" height="13" isRemoveLineWhenBlank="true" />
      <textElement textAlignment="Right">
        
      </textElement>
      <textFieldExpression
class="java.lang.String"><![CDATA[$F{Bewertung}]]></textFieldExpression>
    </textField>
    <frame>
      <reportElement isRemoveLineWhenBlank="true"
        positionType="FixRelativeToTop" width="240" y="0" x="255"
        height="15" stretchType="RelativeToTallestObject" />

      <box>
        <pen lineColor="red" lineStyle="Solid"
          lineWidth="3" />
      </box>

      <textField isStretchWithOverflow="true"
        isBlankWhenNull="true">
        <reportElement mode="Opaque" x="0" y="1"
          width="240" height="13" isRemoveLineWhenBlank="true"
          isPrintWhenDetailOverflows="true"  />
        <textElement verticalAlignment="Top">
          
        </textElement>
        <textFieldExpression
class="java.lang.String"><![CDATA[$F{SCHADENGRUPPE} +
($F{SCHADENBESCHREIBUNG}!=null?$F{SCHADENBESCHREIBUNG}:"")+"
["+$F{SCHADENNR}+"]"]]></textFieldExpression>
      </textField>
    </frame>
  </frame>
  <frame>
    <reportElement isRemoveLineWhenBlank="true"
      positionType="Float" width="545" y="76" x="0" height="155">
      <printWhenExpression><![CDATA[new Boolean( (!($F{BILD1_FILE} == null)
) || (!($F{BILD2_FILE} == null)) )]]></printWhenExpression>
    </reportElement>
    <!--        <box padding="5">
      <pen lineColor="black" lineStyle="Solid"
      lineWidth="3" />
      </box>
    -->
    <image vAlign="Top" hAlign="Center">
      <reportElement positionType="Float" x="303" y="0"
        width="212" height="145" isPrintWhenDetailOverflows="true"
        isRemoveLineWhenBlank="true">
        <printWhenExpression><![CDATA[new Boolean( (!($F{BILD1_FILE} ==
null) ) && ($F{BILD2_FILE} == null) )]]></printWhenExpression>
      </reportElement>
      <graphicElement />
      <imageExpression
class="java.awt.Image"><![CDATA[$F{BILD1_FILE}]]></imageExpression>
    </image>
    <image vAlign="Top" hAlign="Center">
      <reportElement positionType="Float" x="303" y="0"
        width="212" height="145" isPrintWhenDetailOverflows="true"
        isRemoveLineWhenBlank="true">
        <printWhenExpression><![CDATA[new Boolean( (!($F{BILD2_FILE} ==
null)) && ($F{BILD1_FILE} == null) )]]></printWhenExpression>
      </reportElement>
      <graphicElement />
      <imageExpression
class="java.awt.Image"><![CDATA[$F{BILD2_FILE}]]></imageExpression>
    </image>
    <image vAlign="Top" hAlign="Center">
      <reportElement positionType="Float" x="70" y="0"
        width="212" height="145" isPrintWhenDetailOverflows="true"
        isRemoveLineWhenBlank="true">
        <printWhenExpression><![CDATA[new Boolean( (!($F{BILD1_FILE} ==
null) ) && (!($F{BILD2_FILE} == null)) )]]></printWhenExpression>
      </reportElement>
      <graphicElement />
      <imageExpression
class="java.awt.Image"><![CDATA[$F{BILD1_FILE}]]></imageExpression>
    </image>
    <image vAlign="Top" hAlign="Center">
      <reportElement positionType="Float" x="303" y="0"
        width="212" height="145" isPrintWhenDetailOverflows="true"
        isRemoveLineWhenBlank="true">
        <printWhenExpression><![CDATA[new Boolean( (!($F{BILD2_FILE} ==
null)) && (!($F{BILD1_FILE} == null)) )]]></printWhenExpression>
      </reportElement>
      <graphicElement />
      <imageExpression
class="java.awt.Image"><![CDATA[$F{BILD2_FILE}]]></imageExpression>
    </image>
  </frame>

  <line>
    <reportElement positionType="Float" mode="Opaque" x="0"
      y="240" width="525" height="1" />
    <graphicElement pen="Thin" />
  </line>

  <!--
    <frame>
    <reportElement isRemoveLineWhenBlank="true"
    positionType="Float" width="545" y="86" x="0" height="170">
    <printWhenExpression><![CDATA[new Boolean( (!($F{BILD1_FILE} == null) )
|| (!($F{BILD2_FILE} == null)) )]]></printWhenExpression>
    </reportElement>
    <box>
    <pen lineColor="black" lineStyle="Solid"
    lineWidth="1" />
    </box>
    </frame>
  -->
</band>

----- code #2

<textField isStretchWithOverflow="true"
  isBlankWhenNull="true">
  <reportElement mode="Opaque" x="0" y="1"
    width="240" height="13" isRemoveLineWhenBlank="true"
    isPrintWhenDetailOverflows="true"  />
  <textElement verticalAlignment="Top">
    
  </textElement>
  <textFieldExpression class="java.lang.String"><![CDATA[$F{SCHADENGRUPPE} +
($F{SCHADENBESCHREIBUNG}!=null?$F{SCHADENBESCHREIBUNG}:"")+"
["+$F{SCHADENNR}+"]"]]></textFieldExpression>
</textField>


http://www.imagechicken.com/uploads/1240937692037795400.jpg screenshot 1 

http://www.imagechicken.com/uploads/1240937425007514300.jpg screenshot 2 
-- 
View this message in context: 
http://www.nabble.com/Gridlock-with-textfields-with-dynamic-content-tp23315974p23315974.html
Sent from the jasperreports-questions mailing list archive at Nabble.com.


------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions

Reply via email to