m.lausitz85 Posted November 1, 2021 Share Posted November 1, 2021 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? Link to comment Share on other sites More sharing options...
bigalex Posted November 2, 2021 Share Posted November 2, 2021 It's working for me: Image-- Expression: "C:/Users/OneDrive/MyReports/BBC/CC-19/"+$P{FileName}+".png" Link to comment Share on other sites More sharing options...
m.lausitz85 Posted November 3, 2021 Author Share Posted November 3, 2021 With the images it works fine for me too, i just wanted to load the HTML files similar. But that doesnt work. Link to comment Share on other sites More sharing options...
Solution m.lausitz85 Posted November 4, 2021 Author Solution Share Posted November 4, 2021 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) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now