Jump to content
Changes to the Jaspersoft community edition download ×

How to set image in jasper title programmatically


tomsebastan

Recommended Posts

I am creating jasper report without using jrxml template. I need to know how can we set how image in jasper title programmatically?


  
...
//Title
band = new JRDesignBand();
band.setHeight(50);
textField = new JRDesignTextField();
textField.setBlankWhenNull(true);
textField.setX(0);
textField.setY(10);
textField.setWidth(515);
textField.setHeight(30);
textField.setHorizontalAlignment(HorizontalAlignEnum.CENTER);
textField.setStyle(normalStyle);
textField.setFontSize(22);
expression = new JRDesignExpression();
expression.setValueClass(java.lang.String.class);
expression.setText("$P{ReportTitle}");
textField.setExpression(expression);
band.addElement(textField);
jasperDesign.setTitle(band);

[/code]

 


here instead of text field I need to add an image. What should I do?


Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

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...