Jump to content
Changes to the Jaspersoft community edition download ×

Adding a border around TextField using JasperDesign api


colombianboss561

Recommended Posts

Hello,

I'm having an issue with adding borders to textfields while using the JasperDesing api/classes. When I create the exact same .jrxml file through the client vs through the JasperDesign api, I get different results. Witht the client the report is generated as expected but with the api its as follows: 

report(10).jpg.79e2040e5a8512fda4d8740d67546b6a.jpg

 

I've been using the following code to create the textfields. The weirdest thing is that if I remove the border code, it works fine. Clearly the issue is from adding borders to the textfields, but I need to be able to do that.

JRDesignTextField textField = new JRDesignTextField();textField.setMode(ModeEnum.OPAQUE);textField.setBackcolor(Color.LIGHT_GRAY);textField.setFontName(FONT);JRLineBox box=textField.getLineBox();box.getTopPen().setLineColor(Color.WHITE);box.getTopPen().setLineWidth(1);box.getBottomPen().setLineColor(Color.WHITE);box.getBottomPen().setLineWidth(1);box.getLeftPen().setLineColor(Color.GRAY);box.getLeftPen().setLineWidth(1);box.setTopPadding(TOP_PADDING);box.setBottomPadding(BOTTOM_PADDING);box.setLeftPadding(LEFT_PADDING);[/code]

I'm beggingin to think this is an issue as it can only be created using the JasperDesign api and not with the client, or even with the same jrxml file. If anyone has figured out how to solve this issue I would really appreciate the help.

Thanks you.

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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