How to import HTML content (No Styles) into Jaspersoft Text Field?
Posted on November 1, 2021 at 5:36am
Hey Guys,
i have some information in an HTML file. There are more HTML files, which all have content which depends on an input parameter(bold).
as an Example:
file_01.html --> Content: "Bob Bakers"
file_02.html --> Content: "Alice Armstrong"
The HTML files are stored in the repository and I would like to import/load the content of one of these files into a textfield. With some images I've done the same like "repo:/home/res/images/" + $F{html_param} + ".html". And depending on the parameter, it loads the right image.
If it is not possible to do this with an textfield, are there other options to import/load the content and show them in the report?
Joined: Oct 4 2021 - 1:17am
Last seen: 2 months 3 weeks ago
Posted on November 4, 2021 at 5:15am
I#ve found a solution for my problem:
new String(net.sf.jasperreports.repo.RepositoryUtil.getInstance($P{JASPER_REPORTS_CONTEXT}).getBytesFromLocation( "repo:/home/res/html/file_" + $P{PARAM_HTML} + ".html"), java.nio.charset.StandardCharsets.UTF_8)
Joined: Oct 4 2021 - 1:17am
Last seen: 2 months 3 weeks ago
Posted on November 2, 2021 at 2:21pm
It's working for me: Image-- Expression: "C:/Users/OneDrive/MyReports/BBC/CC-19/"+$P{FileName}+".png"
Joined: Apr 12 2019 - 9:15am
Last seen: 1 year 3 months ago
Posted on November 3, 2021 at 3:04am
With the images it works fine for me too, i just wanted to load the HTML files similar. But that doesnt work.
Joined: Oct 4 2021 - 1:17am
Last seen: 2 months 3 weeks ago