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

Conditionally display a link


car_lost

Recommended Posts

I am relatively new to jasper reports and have not been able to find any posts that have directly asked/answered this question.

 

I have a column in my report that renders a link by reference.

 

Code:
<textField pattern="" isBlankWhenNull="true" hyperlinkType="Reference">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="52" height="35" forecolor="#ff" backcolor="#d8dff5"/>
<textElement textAlignment="Right">
<font isUnderline="true"/>
</textElement>
<textFieldExpression class="java.lang.String">. . . and expression . . . .</textFieldExpression>
<hyperlinkReferenceExpression> . . . an expression . . . </hyperlinkReferenceExpression>
</textField>

 

I now need to render the link in only certain conditions. The condition for rendering the link is based on the fields used to render the rest of the row. In the cases where the link is not rendered, I need to render the basic textField described above.

 

I have seen a few posts that refer to using conditional styles as a means to show/hide certain elements.

 

Should i just define two textFields that exist in the same space (e.g. their <reportElement/>'s are identical) and apply conditional styles to each one? If so, is their anything special about the conditional styles I should apply - is there a special style similar to "display:none" that I should be looking for?

 

Carlos

Link to comment
Share on other sites

  • Replies 1
  • 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...