Jump to content
Changes to the Jaspersoft community edition download ×

more on stretch band and isPrintRepeatedValue


Recommended Posts

By: Tzanko - tsanstef

more on stretch band and isPrintRepeatedValue

2003-02-26 09:33

Hi Teodor,

 

Maybe I did not make myself clear about stretching the band

 

1) The way I see it isRemoveLineWhenBlank work for the whole detail.

2) Basically what I want to do is to display a single row from the Record set as multiple lines considering some values. Thus one entry in the RecordSet will be displayed as 3 rows, the other one as 2 rows and some entries will be one row.

3) Some elements have printWhen conditions. The element coordinates are such that they are located one bellow the other - these are the rows I talk about. When the printWhen condition is true that there will be a "row". If it is false there is no row. Note that this is affected by a single entry from the RecordSet. Now the band does not stretched properly when I use isRemoveLineWhenBlank for the elements that I do NOT want to be displayed as a row. moreover I noticed that the last "row" does not get displayed although there is space reserved for it.

 

4) I do not want to print the elements with repeated values for a GROUP. When I use printWhenGroupChanges="true" isPrintRepeatedValues="false"

the values that repeat do not get displayes, but they are not displayed even when the group changes.

I will provide you with a simplified version of my band:

 

<textField>

<reportElement positionType="Float" mode="Transparent" x="0" y="0" width="40" height="14" printWhenGroupChanges="true" isRemoveLineWhenBlank="true" isPrintRepeatedValues="false"/>

<textElement>

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.Integer">$F{v_id}</textFieldExpression>

</textField>

 

<textField>

<reportElement positionType="Float" mode="Transparent" x="175" y="0" width="173" height="14" printWhenGroupChanges="true" isRemoveLineWhenBlank="true" isPrintRepeatedValues="false"/>

<textElement>

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{supplier}</textFieldExpression>

</textField>

 

 

<textField>

<reportElement positionType="Float" mode="Transparent" x="570" y="0" width="60" height="14" isRemoveLineWhenBlank="true"/>

<textElement>

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{accnumb}</textFieldExpression>

</textField>

<textField pattern="0.00">

<reportElement positionType="Float" mode="Transparent" x="650" y="0" width="65" height="14" isRemoveLineWhenBlank="true"/>

<textElement textAlignment="Right">

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.Double">$F{amount}</textFieldExpression>

</textField>

 

<!--

NOW THIS IS MY SECOND ROW

-->

 

<textField>

<reportElement positionType="Float" mode="Transparent" x="570" y="14" width="60" height="14" isRemoveLineWhenBlank="true">

<printWhenExpression>new Boolean((($F{gst_amount}.doubleValue())>0.00))</printWhenExpression>

</reportElement>

<textElement>

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{gst_acc}</textFieldExpression>

</textField>

<textField pattern="0.00">

<reportElement positionType="Float" mode="Transparent" x="650" y="14" width="65" height="14" isRemoveLineWhenBlank="true">

<printWhenExpression>new Boolean((($F{gst_amount}.doubleValue())>0.00))</printWhenExpression>

</reportElement>

<textElement textAlignment="Right">

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.Double">$F{gst_amount}</textFieldExpression>

</textField>

 

<!--

NOW THIS IS MY SECOND ROW

-->

 

<textField>

<reportElement positionType="Float" mode="Transparent" x="570" y="28" width="60" height="14" isRemoveLineWhenBlank="true">

<printWhenExpression>new Boolean((($F{pst_amount}.doubleValue())>0.00))</printWhenExpression>

 

</reportElement>

<textElement>

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.String">$F{pst_acc}</textFieldExpression>

</textField>

<textField pattern="0.00">

<reportElement positionType="Float" mode="Transparent" x="650" y="28" width="65" height="14" isRemoveLineWhenBlank="true">

<printWhenExpression>new Boolean((($F{pst_amount}.doubleValue())>0.00))</printWhenExpression>

</reportElement>

<textElement textAlignment="Right">

<font fontName="sansserif" size="9" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />

</textElement>

<textFieldExpression class="java.lang.Double">$F{pst_amount}</textFieldExpression>

</textField>

 

 

 

 

 

By: Teodor Danciu - teodord

RE: more on stretch band and isPrintRepeatedValue

2003-02-26 12:35

 

Hi,

 

I'm not sure I undestand what you want to achieve.

But I have one more suggestion to make.

Maybe if you split your detail band into 3 separate

bands that run together, using the trick explained

here might help:

 

http://jasperreports.sourceforge.net/tips.tricks.html#largebands

 

You can give up using the actual detail band and

use the group header sections of three dummy

groups with the same group expression:

 

<groupExpression>

$V{REPORT_COUNT}

</groupExpression>

 

Those group headers will behave exactly like a

normal detail band, but you have the advantage that

you can suppress the display of each group header

independently using the <printWhenExpression>

available at band level.

 

I hope this helps.

Teodor

 

 

 

 

 

By: Tzanko - tsanstef

RE: more on stretch band and isPrintRepeatedValue

2003-02-27 08:25

10x a lot,

I think that will do the trick

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...