mhbashar1 Posted January 11, 2008 Share Posted January 11, 2008 Can anybody pls tell me the difference between1.print when expression and text field expression of a textfield 2.Variable expression and initial value expression of a variable Would u pls give a little example of both.Thanx. Link to comment Share on other sites More sharing options...
C-Box Posted January 11, 2008 Share Posted January 11, 2008 Well I'll try... 1.) TextExpression of a TextField is WHAT is printed... so what Field value or if you use some more complex TextExpressions you could do something like: Code:"captiontext: " + $F{Field0815} + " / " + $F{Field0816} 2.) PrintWhenExpression is an expression of ANY Element to show/print it or not (so WHETER a field - or better an element - is printed).if the expression returns true it will be printed otherwise it won't be printede.g. Code:[code]new Boolean($F{Field0815}.equals("SomeText"«»)) 3.) a VariableExpression is an expression to calculate for example a field (e.g. the sum of Field0815) 4.) a intitial ValueExpression is the value that the variable get BEFORE any calculation will happen. (so the initial value for some cases the VariableExpression won't be calculated and you don't want to see null but better BigDecimal.ZERO. if the variable is reset the initial value is set again (so for each page, group or whatever resettype you choose) hthC-BoxPost edited by: CBox, at: 2008/01/11 10:13 Link to comment Share on other sites More sharing options...
mhbashar1 Posted January 12, 2008 Author Share Posted January 12, 2008 Very many thanx brother.Brother can u tell me what to write in textfield expression if I want to set/unset its border dynamically depending upon some condition,I mean suppose - $P{name}!=null then set the border of textfield.And Can I put more than one if()condition in the expression (not nested).Thnx again. Link to comment Share on other sites More sharing options...
C-Box Posted January 13, 2008 Share Posted January 13, 2008 Therefor you have to create a ConditionalStyle.... in iReport it's somewhere in menue (I'm at home now... so I guess to remember "Edit" --> "Styles"...) Just create a Style "MyBorders" and add some conditions where you set the expression to your needs. You can add as many expressions as you want. For each condition you can set different element properties (colors/fonts/borders/whatever....) At your textfield you just have to set that style in the properties. it's quite simple regardsC-Box Link to comment Share on other sites More sharing options...
mhbashar1 Posted January 13, 2008 Author Share Posted January 13, 2008 mhbashar1 wrote:2.) PrintWhenExpression is an expression of ANY Element to show/print it or not (so WHETER a field - or better an element - is printed).if the expression returns true it will be printed otherwise it won't be printedAccording to u,if I put this-new Boolean($F{Field0815}.equals("SomeText")) in the PrintWhenExpression, does it mean that if the "SomeText" matches with $F{Field0815},only then the textfiled will be shown? IS IT SO? How can I show my entire textfield with value on such condition. Link to comment Share on other sites More sharing options...
C-Box Posted January 13, 2008 Share Posted January 13, 2008 Well again: if your PrintWhenExpression is: Code:new Boolean($F{Field0815}.equals("SomeText"«»)) and your Field0815 has "SomeText" as value... than the whole field is printed. if your Field0815 has "OtherText" as value... than the whole field is not printed. ...this question I don't understand:How can I show my entire textfield with value on such condition. Please describe a bit more in detail what you want to achieve. hthC-Box Link to comment Share on other sites More sharing options...
mhbashar1 Posted January 14, 2008 Author Share Posted January 14, 2008 Brother I think u've already answered my question.By this- How can I show my entire textfield with value on such condition.I wanted to mean that depending on the passing text value("Sometext"),I want to show/hide my textfield.Actually I want to put a border around my textfield,then if $F{Field0815} matches "Sometext" the textfield will be shown,otherwise the textfield will not be shown.Can I do it? 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