pradiptab Posted April 21, 2011 Share Posted April 21, 2011 Hello EverybodyI 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 More sharing options...
Teodor Danciu Posted April 21, 2011 Share Posted April 21, 2011 Hi, If styled text is not enough for what you want to achieve, then you'll have to wait for a future version in which we'll try to solve this problem by refactoring the JR file format. Thanks,Teodor Link to comment Share on other sites More sharing options...
jpauze Posted April 21, 2011 Share Posted April 21, 2011 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 More sharing options...
pradiptab Posted April 22, 2011 Author Share Posted April 22, 2011 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 More sharing options...
jpauze Posted April 22, 2011 Share Posted April 22, 2011 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 More sharing options...
pradiptab Posted April 23, 2011 Author Share Posted April 23, 2011 Hi jpauzeFirst of all thanks for your help, which working fine for me. As I am new to iReport this was a misunderstanding from myside. Trying to digg more on conditional formatting. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now