Jump to content

Customizing report elements such as TextFields.


drsaturno

Recommended Posts

I'm wondering if  there is any elegant solution for customizing report elements.

I'd like to have a different way of configuring a TextField "Pattern", and thought about creating a new TextField with this different feature.

I started to study the source code, but I coud not find an elegant solution. I could simply overwriting the JRBaseTextField, but this is ugly, very ugly.

After some research on the source code I realized that JRBaseTextField's code has a strong coupling. Even extending JRBaseTextField, I would have facing problems using the extended class.

It seems that iReport has great plug-in features, but I cannot using this for add my new TextField report element, right?

Thanks!


Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

drsaturno
Wrote:

It seems that iReport has great plug-in features, but I cannot using this for add my new TextField report element, right?

Right.  But you can implement your fresh element type as a custom component.  That might be too much if you only want to change one function of the text field element, but it might be worth looking into it.

You can also check the JRParameter.html.REPORT_FORMAT_FACTORY parameter.

Regards,

Lucian

Link to comment
Share on other sites

shrije
Wrote:

same here. i need to set the Forecolor and BackColor of a text element with a java expression. I am not sure if it is possble.

It's not.

Using conditional styles you can select from a fixed set of colors, but you cannot have an expression that assigns an arbitrary color.

Regards,

Lucian

Link to comment
Share on other sites

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