Jump to content
We've recently updated our Privacy Statement, available here ×

Programming Backcolor of field


pradiptab

Recommended Posts

Hello Everybody

I am in a situation where I need to set the back color of a text field programatically for each record.

So is there any way to do so ? Can we write any expression which can handle the backcolor property of the text field ?

I can think of an alternative by placing an image field at the background and providing the required colored image.

But is there any direct way to do so inside iReport ?

Thanks,

Pradipta

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

I agree with Teodor, Conditional Sytles should be all you need to accomplish this, I use them all the time to color code either the background color or the font color and style based on various conditions and they work amazing. The only time I ever go the route of using multiple fields with print expressions is when I want to physically use graphics such as check boxes or visual status indicators and such. There are lots of posts in the forum on this subject as well as many examples in the sample library and of course the documentation (which is worth the minimal price they charge)
Link to comment
Share on other sites

Thanks for your suggestions.

For my problem it will better to place multiple fields and to control there visibility by using print expressions. I have just forgotten that. Thanks for your helps. I am going to implement it. :)

But I hope in future there should be a way to handle the style dynamically when the style depends on user inputs at run time.

Thanks,

Pradipta

Link to comment
Share on other sites

 

Pradipta,

For the the benefit of the rest of us you can expand on specifially the condition you are trying to check?   I don't understand the statement "But I hope in future there should be a way to handle the style dynamically when the style depends on user inputs at run time"  as i Report/Japser fully supports this through the use of "conditional styles"  and it is quite simple to have different styles controlled by paramaters, or variables, or fields etc.  

Just trying to understand where the gap would be and why conditional styles wouldn't meet your needs?

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