Is it possible to update a field as part of a report?


I am thinking specifically of two cases:

  • A flag (boolean field) that is set when a row is printed
  • A sequence number that is auto-incremented when a row is printed

Hoping someone has done this etc.

Thanks in advance, even if the answer is an unequivocal "no."

andrew_50's picture
Joined: Jan 25 2018 - 8:33am
Last seen: 1 week 2 hours ago

3 Answers:


You'll have to do it outside JasperReports or modify JasperReports library to do that.

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 year 10 months ago

Not really, the report is only executing the main query and subdataser queries, it doesn't communicate with the database afterwards.

Friendly User's picture
Joined: Oct 8 2009 - 5:59am
Last seen: 1 week 3 days ago

You could use an own scriptlet class to update your field(s) within the database after it's printed

For e.g. when your field is placed in a common detail band you could implement afterDetailEval.

see here or also here

hth + regards


C-Box's picture
Joined: Jul 19 2006 - 5:58pm
Last seen: 3 months 4 weeks ago