Show and Export different Jasper in JasperServer

0

I am new in JasperServer and I need to achieve the next functionality:

I want to show a PDF with one jrxml into the JasperServer (this is simple). But then, when the user click on "Export to PDF" I need to show some more fields in the generated PDF.

I don´t know If I can upload 2 different jrxml (one to show it and one to export it), or if I can pass a parameter so the jasper will know if it has to print the added fields.

Any idea will be appreciated.

jorge.pielagos's picture
Joined: Jun 15 2016 - 1:11am
Last seen: 4 years 1 month ago

1 Answer:

1
You could try to use the [net.sf.jasperreports.export.{format}.exclude.key.{suffix}][1]
 
The strategy would be to exclude the fields (reportElements) from all other export types then pdf
 
    <jasperReport ...> 
      <property name="net.sf.jasperreports.export.html.exclude.key.myField"/>
      <property name="net.sf.jasperreports.export.graphics2d.exclude.key.myField"/>
       ....
      <textField>
<reportElement key="myField" x="45" y="35" width="125" height="20" uuid="5c2bb49a-ba95-4cb7-8c46-c32a0769e5e9"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{field1}]]></textFieldExpression>
</textField>
    </jasperReport>
 
 
jorge.pielagos's picture
Joined: Jun 15 2016 - 1:11am
Last seen: 4 years 1 month ago
Feedback