Jump to content
Changes to the Jaspersoft community edition download ×

Formatting problem


Recommended Posts

By: Gregory A. Swarthout - gswarthout

Formatting problem

2003-03-24 12:09

This one is better seen than described.

 

Take a look at these two html files:

 

http://www.xmission.com/~gregorys/move/Ex1.html

http://www.xmission.com/~gregorys/move/Ex2.html

 

In the first one, Ex1.html, the fourth detail item is three lines tall while

all the rest are two lines tall, as they should be. None of the columns

has isStretchWithOverflow set to true.

 

In the second one, Ex2.html, I have set the City + ", " + State column

to have isStretchWithOverflow="true". A third line now appears as needed,

and also appears on occasion when not needed (details 1, 5, 10). I've

verified that the data itself does not contain any linefeeds or carriage

returns. Interesting to note is that the fourth detail item now fits

into two lines!

 

Do you have a fix for this/these problem(s)?

 

Greg

 

PS: Incidentally, I much prefer the way the detail section stretched in

the first example (despite the fact that it shouldn't have). What I mean

is that the background colors of the other columns also stretched, whereas

in the second example, the background colors of the other columns did not

stretch and left "holes" in the report. Which way is it supposed to

happen?

 

If it's supposed to happen as in the first example, could you provide an

attribute that would set a vertical text alignment for stretched columns in

the same manner that you allow for horizontal text alignment?

 

 

 

 

By: Mark Wilson - markwil

RE: Formatting problem

2003-03-24 12:35

Had exactly this problem. Teodor sent me this, which works (important is stretchType="RelativeToTallestObject"):

 

Try this detail band:

<detail>

<band height="20">

<elementGroup>

<rectangle>

<reportElement x="0" y="0" width="800" backcolor="#E4E2E3" height="15"

isPrintWhenDetailOverflows="true">

<printWhenExpression>new Boolean($V{counter}.intValue() % 2 ==

1)</printWhenExpression>

</reportElement>

<graphicElement stretchType="RelativeToTallestObject"/>

</rectangle>

<textField pattern="">

<reportElement x="0" y="0" width="40" height="15"/>

<textElement>

<font reportFont="Arial_Data"/>

</textElement>

<textFieldExpression

class="java.lang.String"><![CDATA[$F{kdnr}]]></textFieldExpression>

</textField>

<textField pattern="" isStretchWithOverflow="true">

<reportElement x="60" y="0" width="250" height="15"/>

<textElement>

<font reportFont="Arial_Data"/>

</textElement>

<textFieldExpression

class="java.lang.String"><![CDATA[$F{firma}]]></textFieldExpression>

</textField>

<textField pattern="" isStretchWithOverflow="true">

<reportElement x="330" y="0" width="300" height="15"/>

<textElement>

<font reportFont="Arial_Data"/>

</textElement>

<textFieldExpression

class="java.lang.String"><![CDATA[$F{adresse}]]></textFieldExpression>

</textField>

<textField pattern="" isStretchWithOverflow="true">

<reportElement x="650" y="0" width="150" height="15"/>

<textElement>

<font reportFont="Arial_Data"/>

</textElement>

<textFieldExpression

class="java.lang.String"><![CDATA[$F{ansprechpartner_info}]]></textFieldExpression>

</textField>

</elementGroup>

</band>

</detail>

 

- Mark

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...