Jump to content
Changes to the Jaspersoft community edition download ×

How to set a variable value equal to a field value where id is equal to a certain value?


Recommended Posts

Hello all.

Before I state my issue I just want to provide some information on my specs.

I'm using a mysql database as my datasouce and jaspersoft studio community edition v6.3.1.

The report I'm creating should have a title page that displays very specific information from the first few rows in my database. For example:

21Example CompanyExample Text0
31Financial ReportQ10

Knowing this (and also knowing that the data can change based on user inputs), I wanted to be able to store the value of a specific field into a variable where the id was equal to a certain value.

I created a variable and set the Inital Value Expression to this: $F{id}.equals(3) ? $F{sectiontext} : "Nothing"

I then placed that variable onto the Title section of the report designer to see what would display when Previewing the report and I only got null

So with that being said, is it possible to store the value of a field into a variable WHERE the primary key for that row is equal to a certain value? and if so, does that mean the value of the variable does not change so long as the value in the datasource is the same even when the report is in run time?

If anyone knows how to implement or even if this is possible, please let me know! 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...