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

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

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: 7 months 4 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: 7 months 4 weeks ago

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

bigalex's picture
2180
Joined: Apr 12 2019 - 9:15am
Last seen: 3 months 3 weeks 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: 7 months 4 weeks ago
Feedback