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

imageExpression in Java


Recommended Posts

By: Daryl Jackson - dkjjr

imageExpression in Java

2003-05-22 05:19

I have the following code in XML to print out graphics:

 

<image scaleImage="Clip">

<reportElement x="722" y="0" width="100" height="50">

<printWhenExpression>new java.lang.Boolean($P{isSubReport}.equals(java.lang.Boolean.FALSE))</printWhenExpression>

</reportElement>

<imageExpression>"xml/jasper/bell_logo_white.png"</imageExpression>

</image>

 

When I try this in Java I get a compilation error on expression.setText():

 

image = new dori.jasper.engine.design.JRDesignImage();

image.setScaleImage(dori.jasper.engine.JRImage.SCALE_IMAGE_CLIP);

image.setX(722);

image.setY(0);

image.setWidth(100);

image.setHeight(50);

expression = new dori.jasper.engine.design.JRDesignExpression();

expression.setValueClass(java.lang.String.class);

expression.setText("xml/jasper/bell_logo_white.png");

image.setExpression(expression);

band.addElement(image);

 

What am I doing wrong?

 

Thank you kindly!

 

 

 

 

 

By: Teodor Danciu - teodord

RE: imageExpression in Java

2003-05-22 06:01

 

Hi,

 

Try this:

 

expression.setText(""xml/jasper/bell_logo_white.png"");

 

Thank you,

Teodor

 

 

 

 

 

By: Daryl Jackson - dkjjr

RE: imageExpression in Java

2003-05-22 18:35

Great! Thanks!

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