Is it possible to update a field as part of a report?
Posted on March 6, 2019 at 8:06am
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."
Posted on March 6, 2019 at 1:43pm
You'll have to do it outside JasperReports or modify JasperReports library to do that.
Posted on March 11, 2019 at 3:04pm
Not really, the report is only executing the main query and subdataser queries, it doesn't communicate with the database afterwards.
Posted on March 11, 2019 at 11:41pm
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