Jump to content
JasperReports Library 7.0 is now available ×

insert an image in cross tab report


meiqing

Recommended Posts

Dear All,

I am very new to ireport. My problem is to dynamically display an image in cross tab report. I am generate a report for survey. the cross tab header column are choice text like below

 

NA SELDOM ALWAYS

 

Y N N

N Y N

N Y N

 

My goals is to display a filled radio button image for answer Y and non-filled radio button image for answer N.

 

Here is what I tried.

create crosstab parameter image1 and image2

<crosstabParameter name = "image1" class="java.lang.String"

<parameterValueExpression><![CDATA["C://image1"]]></parameterValueExpression>

</crosstabParameter>

...

 

In the cross tab field where display Y and N I have this expression

 

<textFieldExpression class="java.lang.String">

<![CDATA[$V{ANSWER} == "Y" ? $P{image1} : $P{image2}]]>

</textFieldExpression>

 

However, as you can expect I get the string "C://image1" in Y field instead of the radio button.

My question is if there is a way to pass the image object in the cross tab or is there any way I can pass it through the java code?

I have searched for couple of weeks before I post this.

Any suggestion or comment is highly appreciated.

 

Merry Christmas to you all!

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 9 years later...

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