Cell Values in expressions
Joined: 02 Apr 2013
Topic: Cell Values in expressions
Posted: 02 Apr 2013 at 11:59pm
In the <#Config> sheet I am trying to create an expression based on the Demo I saw for formatting Alternate Rows.
The expression there is <#if(mod(row(e32),2)=1;<#format cell(Yellow)>;)>
The "e32" in this case I assume gets updated with the row as it expands.
Is there a way to get the value of the current Cell, in the case where the expression is used in multiple columns in the same row.
Cell H6 the expression "DS" is <#if(H6 ="DS";<#format cell(DS)>;)>
when applied to I6 the expression needs to be <#if(I6 ="DS";<#format cell(DS)>;)>
What do I need to use in the Expression to get the value of the current cell?
Joined: 18 May 2010
|Post Options Quote Reply Posted: 03 Apr 2013 at 5:43am|
The main problem here is that H6 might change its contents before or after the expression, this sin't defined. If you use "Row(e32)" this is ok, because Row(e32) will be the same before and after the report runs. Also if H6 is constant, say "hello", that is ok too.
But if H6 itself has an expression or formula, then the result is not defined and this should not be used. This is because at the time of evaluating the expression the value of the cell hasn't changed yet, so instead of the string "result" it still is the string <#if H6...>
The way to deal with this is to not refer to cells that are not constant, and see to use the expression that gives value to the cell instead.
For example, let's define an expresssion H6Value = <#whatever defines h6>
and then in H6 you would write:
<#h6value><#if (<#h6value>="DS";<#format cell(DS)>;)>
Sadly you will have to do the same for i6. To simplify a little, you could use an expression with parameters (see the "expression parameters" demo and in particular the "Format(value;minimum)" expression as it is this exact case). For this case you would define instead:
FormatDS(value) = <#value><if(<#value>="DS";<#format cell(DS)>;)>
and in H6 you would write <#FormatDS(<#whatever goes in h6>)>
|Forum Jump||Forum Permissions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum