Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make editable PDF fields in a Jasper report

Is there a way to export a Jasper report in PDF where designated fields can be left editable? I'm using iReport to design the report templates.

like image 211
Eric Hydrick Avatar asked May 03 '11 13:05

Eric Hydrick


3 Answers

It's not possible today. It's an unusual requirement, but it's not unreasonable. It's really not an iReport limitation but rather a JasperReports limitation. If anyone coming to this post in the future would like to have this feature, the best thing to do would be to log it in the Jaspersoft bug tracker.

like image 90
mdahlman Avatar answered Oct 17 '22 22:10

mdahlman


Editable inputs are possible with newer releases of JasperReports.

Example:

<reportElement positionType="Float" mode="Opaque" x="250" y="0" width="200" height="50">
  <property name="net.sf.jasperreports.export.pdf.field.type" value="Text"/>
  <property name="net.sf.jasperreports.export.pdf.field.text.multiline" value="true"/>
  <property name="net.sf.jasperreports.print.keep.full.text" value="true"/>
  <propertyExpression name="net.sf.jasperreports.export.pdf.field.value">"This\nis a multi\nline text inside a single line text field."</propertyExpression>
</reportElement>

Documentation:

http://jasperreports.sourceforge.net/sample.reference/forms/index.html

like image 38
yglodt Avatar answered Oct 17 '22 22:10

yglodt


Two facts:

  1. iText can do it. http://www.geek-tutorials.com/java/itext/itext_acroform_javascript.php#code2src

  2. JasperReports use iText.

Theoretically, JR can do it, but I don't find methods in javadoc, that used parameters.

Maybe anybody know?

like image 23
Oleg Poltoratskii Avatar answered Oct 17 '22 22:10

Oleg Poltoratskii