views:

509

answers:

3

Referencing the page number variable in JasperReport as $V{PAGE_NUMBER}. Of course that works fine. However, I would like this report to have a page number preceded by a letter, as in:

A-1
A-2
...
A-N

Unfortunately, this does not appear to be permitted. Even when I get the expression editor to accept an expression, it still fails to compile. Always with "cannot cast from String to Integer", or "cannot cast from Integer to String" errors, or sometimes both.

"A-".concat($V{PAGE_NUMBER}.toString()) does not work. No possible variation works, mystifyingly.

A: 

Yeah, you can't teach smart. I neglected to change the field type from Integer to String. And I was about to disparage an awesome free product. D'Oh.

AK
A: 

Just a note, you can write it as "A-" + $V{PAGE_NUMBER}

medopal
A: 

No the above doesnt work....can ne 1 explain it better..

Siddhesh