azinyue_1 Posted April 16, 2013 Share Posted April 16, 2013 Hallo there,I have a software to manage schools, and I need to create a reports and certificates as well.However I have not been able to produce certificates with Jasper reports. Need help here. Can someone direct me on how to decorate a report certificate style ? Thanks Link to comment Share on other sites More sharing options...
Ankur Gupta Posted April 18, 2013 Share Posted April 18, 2013 Hi,What you need to do is add a property to the fields you are wanting referenced. To add the class name you need to add net.sf.jasperreports.export.html.class and to include an id you need to addnet.sf.jasperreports.export.html.id as a property. As an example, below is a Text field that sets both: In iReport you add these by selecting the field, and then in the properties window clicking the ellipses button next to Properties expressions. http://i.stack.imgur.com/mIRwA.pngTo include the link to the css file in the exported report, you need to set the value for theJRHtmlExporterParameter.HTML_HEADER parameter before exporting. Note the parameter is not the header in the sense of HTML (the contents of the head tag), but the header of the exported HTML report. Meaning it is what is first placed in the exported report to begin with, before including the report. The default that Jasper Reports uses is: So you will need to modify this to include the link to your stylesheet by adding:to that in the appropriate place, which I think is inside the head tag, but if not move to appropriate area. So the java code would end looking something like: 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