Jump to content
Changes to the Jaspersoft community edition download ×

Add HtmlComponent to JasperDesign


valentin.gregoire
Go to solution Solved by valentin.gregoire,

Recommended Posts

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.1
  • HtmlComponent 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?

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...