Jump to content
We've recently updated our Privacy Statement, available here ×

CROSSTAB CELL STYLE


Krac

Recommended Posts

Hello, everyone!

Below is a style defined for a cell of a crosstab:

 

 

Code:
<style 
name="style_p"
isDefault="false"
>

<conditionalStyle>
<conditionExpression><![CDATA[new Boolean($V{SET_INDEX_Nothing}.intValue() <= $V{High_MB_IDX}.intValue())]]></conditionExpression>
<style
name="style_p"
isDefault="false"
backcolor="#FF3300"
border="1Point"
borderColor="#FF3300"
topBorder="1Point"
topBorderColor="#FF3300"
leftBorder="2Point"
leftBorderColor="#FF3300"
bottomBorder="1Point"
bottomBorderColor="#FF3300"
rightBorder="1Point"
rightBorderColor="#FF3300"
/>
</conditionalStyle>
</style>

 

The problem is that everything works except the BORDER COLOR (borderColor="#FF3300"). That one is not overridden by the style. Is there any other syntax or possibility to use the border defined in a style for the cell's border?

 

TIA,

 

Razvan

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello, Lucian and thanks for the reply :)

 

My answer is: Yes, I do have a have a <box> specification for the <cellContents>.

Following is the code:

 

Code:

<crosstabCell width="50" height="21">
<cellContents mode="Opaque" style="style_p">
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
style="style_p"
mode="Transparent"
x="39"
y="1"
width="11"
height="15"
key="textField">
<printWhenExpression><![CDATA[new Boolean($V{SET_INDEX_Nothing}.intValue() == $V{High_MB_IDX}.intValue())]]></printWhenExpression>
</reportElement>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font/>
</textElement>
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{SET_INDEX_Nothing}]]>
</textFieldExpression>
</textField>
</cellContents>
</crosstabCell>

 

Problem is that everything from the defined style is processed, except the borders (neither the color, neither the thickness)!

So the crosstab cell borders are not overridden by the defined style.

 

What can be wrong?

 

Thanks again,

 

Razvan

Link to comment
Share on other sites

The style overriding mechanism works in the opposite direction: the element attributes override attributes defined in the style (even attributes defined in conditional styles, which is slightly counterintuitive).

 

The border attributes defined for your cell override hence the attributes in the conditional style. Put these attributes in the base style and remove them from the cell:

Code:

<style name="style_p" isDefault="false" topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000">
<conditionalStyle>
..etc..
</style>
..
<cellContents style="style_p">
<!-- no border attributes -->
..
</cellContents>

 

HTH,

Lucian

Link to comment
Share on other sites

hello!

I have the same problem.

Using iReport there are default properties for the <box> tag like border="None" and color="#000000".

Even if I remove them from jrxml,when I run the report this defaults values are setted back.

How can I drop this properties from <box>?

 

Thanx.

Link to comment
Share on other sites

cristip wrote:

Using iReport there are default properties for the <box> tag like border="None" and color="#000000".
Even if I remove them from jrxml,when I run the report this defaults values are setted back.

 

This sounds like an iReport issue, and the right audience for such questions is of course on the iReport forum. Reposting the question there would be a good idea.

 

Regards,

Lucian

Link to comment
Share on other sites

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