Jump to content
Changes to the Jaspersoft community edition download ×

Stupid Expression Question


2004 IR Help

Recommended Posts

By: Patrick Casey - pcasey

Stupid Expression Question

2005-10-29 18:28

 

I have two fields:

$F{code} is a short string (like "A")

$F{sequence} is an integer (like 0)

 

I want to output:

 

$F{code} + ($F{sequence} + 1)

 

e.g. if code = A and sequence = 0 I want to output: A1

 

I'm going round and round in circles with jasper expression trying to make this work though. Either I end up with

 

A01 (string concatenation)

or compile failures for what I'm sure is really easy.

 

Could anyone help me out here?

 

 

 

 

By: Lucian Chirita - lucianc

RE: Stupid Expression Question

2005-10-31 07:54

Jasper expressions are Java expressions and Jasper fields are Java objects.

 

If $F{sequence} is a java.lang.Integer object, what you want is $F{code} + ($F{sequence}.intValue() + 1).

 

Regards,

Lucian

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