valentin.gregoire Posted March 2, 2017 Posted March 2, 2017 Through various searches on the internet I found how to use the HtmlComponent in my project to have an HTML-table in my report (as an image).However, I can't seem to find how I can add the HtmlComponent to a JasperDesign.Versions in use:Jasper 5.6.1HtmlComponent 5.0.1 (derived from iReport 5.6.0).My current code:HtmlComponent table = new HtmlComponent();JRDesignExpression expression = new JRDesignExpression();expression.setText(html.replace("n", ""));table.setHtmlContentExpression(expression);JRDesignGroup group = new JRDesignGroup();group.setName(TABLE_GROUP_PREFIX);JRDesignBand groupHeader = new JRDesignBand();groupHeader.setHeight(200);groupHeader.setSplitType(SplitTypeEnum.IMMEDIATE);groupHeader.addElement(table);((JRDesignSection) group.getGroupHeaderSection()).addBand(groupHeader);return jasperDesign;[/code]Obviously, groupHeader.addElement(table) doesn't work since table is not an element but a component. Anyone and idea?
hozawa Posted March 3, 2017 Posted March 3, 2017 This isn't a direct answer to your question butHTML Component is obsolete. Use Custom Visualization component instead. It allows to use svg.
valentin.gregoire Posted March 3, 2017 Author Posted March 3, 2017 hozawa, is that supported through jasper 5.6.1?EDIT: I found something interesting here: http://community.jaspersoft.com/wiki/custom-visualization-component-jaspersoft-studio-v56xI am not sure however if it will be usable.
Solution valentin.gregoire Posted March 6, 2017 Author Solution Posted March 6, 2017 Since I wasn't expecting as much action here as on StackOverflow, I posed my question there as well. The answer to my problem is written there:http://stackoverflow.com/questions/42560528/how-to-add-the-htmlcomponent-to-jasperdesign
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