reading a textfile


Hi all,

I have a directory where the sources for creating a pdf are located (config.yaml and *.jrxml). In order to have a version control there is a file in this directory called 'VERSION'. The content thereof is e.g. "Version 2.1.13". Now this string should be output in the PDF. Is there a possibility within the * .jrxml to read the text file?

floraoma2000-javascript's picture
Joined: Feb 13 2020 - 7:21am
Last seen: 1 week 3 days ago

1 Answer:


One option would be to use the CSV data adapter to read the text file. 

A quick search pulled up this JDBC driver that can read a text file; wsvjdbc.

Another option is to write a scriptlet that returns the contents of the specified file.  I currently do this to assist in finding the location of my subreport when we move between dev, test, and prod.

jgust's picture
Joined: Jun 10 2010 - 6:39am
Last seen: 2 days 2 hours ago