3 Replies - 1228 Views - Last Post: 17 November 2011 - 07:27 PM Rate Topic: -----

#1 acll19  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 63
  • Joined: 20-October 10

ireport 4.0.2 + expression issue

Posted 16 November 2011 - 02:40 PM

Hi, there. I'm new with jasperreport. I made a report to show all the data from a database table, but one of the fields is an integer (0 or 1) and I want it to show Yes for 1 and No for 0. Searching the net I found that I have to make a scriptlet to do so. Then to use the scriptlet I have to assign it to the static text I want to show the value. There's where I got stuck, the thing is I'm using netbeans with the ireport 4.0.2 plugin and I can't seem to find the way to do so. I will apriciate any help.

Is This A Good Question/Topic? 0
  • +

Replies To: ireport 4.0.2 + expression issue

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8376
  • View blog
  • Posts: 31,956
  • Joined: 06-March 08

Re: ireport 4.0.2 + expression issue

Posted 16 November 2011 - 06:49 PM

String[] yesNo = {"no", "yes");
....
System.out.printl(yesNo[value]);
Was This Post Helpful? 0
  • +
  • -

#3 acll19  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 63
  • Joined: 20-October 10

Re: ireport 4.0.2 + expression issue

Posted 16 November 2011 - 10:43 PM

I made a scriptlet which already has a method that does that. My question is more about how I can assign the return value to a static text element for instance. I'm sorry if I didn't make my point earlier. I was following a tutorial that used the ireport plugin for netbeans version 3.5.3 and I'm using version 4.0.2, I'm guessing that what I want to do is done some way diferent.

Thanks anyway, I apriciate your help, your always willing to help other people.
Was This Post Helpful? 0
  • +
  • -

#4 acll19  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 63
  • Joined: 20-October 10

Re: ireport 4.0.2 + expression issue

Posted 17 November 2011 - 07:27 PM

I have solved the problem, the thing is I was trying to change the value of a static text element and, as its name reads, it can't be changed. So you have to use a text field elemnt instead.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1