Jasper Report Development — important facts

Jasper Report project 6.4.1 dependencies :

commons-beanutils-1.9.3.jar
commons-collections-3.2.2.jar
commons-digester-2.1.jar
commons-logging-1.2.jar
itext-2.1.7.jar
jasperreports-6.4.1.jar
jasperreports-chart-customizers-6.4.1.jar
jasperreports-chart-themes-6.4.1.jar
jasperreports-fonts-6.4.1.jar
jasperreports-functions-6.4.1.jar
jasperreports-javaflow-6.4.1.jar
joda-time-2.3.jar
org.springframework.beans-3.0.5.RELEASE.jar
org.springframework.core-3.0.5.RELEASE.jar
spring-core-3.0.5.RELEASE.jar

*Note that jasperreports-chart-themes-6.4.1.jar dependent on spring framework jars.If you are not using jasperreports-chart-themes you can avoid spring jars.

https://www.dropbox.com/s/l4w65a7lbxo4ibb/TOTAL_LIBS.zip?dl=0

(1) Stretch over large content in text field — select text box ->Advanced -> show properties

(2) Change the item position according to the upper element content sizes (dynamically) — select item -> show properties -> Appearance -> Position Type -> Float

(3) Print item with conditions — select item -> show properties -> Advanced -> Print When Expression

(4) Dynamic sized borders

First create a border using lines and keep separate parts for dynamic hiding contents

For example above figure we are going to hide sample two when data is null or empty.

  • Right click on selected items -> show properties -> Appearance -> Remove Line when blank
  • Right click on selected items -> show properties -> Advanced -> Print When Expression

Click on Print when Expression -> Expression Editor

Assign null to TestTable class sampleTwo parameter.Now the table adjust dynamically according to the data.

Final results :

Sample project can be found here.

https://github.com/sampathsl/jasper-report-work

Show your support

Clapping shows how much you appreciated Sampath Thennakoon’s story.