How to import HTML content (No Styles) into Jaspersoft Text Field?

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?

 

 

m.lausitz85's picture
Joined: Oct 4 2021 - 1:17am
Last seen: 2 months 3 weeks ago

3 Answers:

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)

m.lausitz85's picture
Joined: Oct 4 2021 - 1:17am
Last seen: 2 months 3 weeks ago

It's working for me:  Image-- Expression: "C:/Users/OneDrive/MyReports/BBC/CC-19/"+$P{FileName}+".png" 

bigalex's picture
3274
Joined: Apr 12 2019 - 9:15am
Last seen: 1 year 3 months ago

With the images it works fine for me too, i just wanted to load the HTML files similar. But that doesnt work.

m.lausitz85's picture
Joined: Oct 4 2021 - 1:17am
Last seen: 2 months 3 weeks ago
Feedback