Jump to content

Problem with Alternate Colour and subreport


fenix4life

Recommended Posts

Hello,

 

It looks like I have an issue with alternating colours when a subreport is empty.

What I need is two distinct lists which both have alternating colour.

What I did is create a main and a subreport. Both report have an identical style and conditionalStyle tag. Then a frame was added with the needed fields. This frame is then linked to the defined style.

 

Now when I generate the report with an ID which result in main and subreport to retrieve records then the generate result has alternating colours. If I then select an ID which does not have any records in the subreport then I don't have any alternating colours in the main report.

 

I thought this might be linked to the fact I was using the same style name in main and subreport. After changing this, this did not make any difference.

 

Any idea what might be the trigger of this?

Code:
<style name="AlternateDetail" isDefault="false">   <conditionalStyle>      <conditionExpression>         <![CDATA[new Boolean(  $V{REPORT_COUNT}.intValue() % 2 == 1  )]]>      </conditionExpression>      <style isDefault="false" style="AlternateDetail" mode="Opaque" backcolor="#E6E6E6"/>   </conditionalStyle></style><frame>   <reportElement style="AlternateDetail" x="0" y="0" width="766" height="11"/>   <textField isStretchWithOverflow="true">      <reportElement x="14" y="0" width="209" height="11"/>      <textElement>          <font size="8"/>      </textElement>      <textFieldExpression class="java.lang.String"><![CDATA[($F{Foo}.equals( null )? $F{FOO}: "     ".concat($F{BAR}))]]>      </textFieldExpression>   </textField>   ...</frame>
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...