Why is LL.CurrentValue different from Value expression in Crosstab?

I’m using the LL23 designer to generate a report from XML data.
The data is mostly numerical but can contain “inf”, “-inf” or “n/a”.
I use the following Value expression in the Crosstab to convert these to specific values:

If(Contains(Lower$(TOTResult.Value), "n/a"), 12345, ToNumber(StrSubst$(TOTResult.Value, "inf", "999999999")))
This works OK, e,g, I get 12345 for “n/a” (tested in an additional cell; Displayed Contents is TOTResult.Value so “n/a” is displayed).
My problem is in the Conditional Formatting Condition.
There it is not possible to use TOTResult.Value and Displayed Contents is also not accessible; furthermore, trying to use Crosstab.Value() there leads to a crash in LL.
Therefore I have to use LL.CurrentValue (which is actually the reason for the specific value 12345).
Unfortunately LL.CurrentValue returns 0 for “n/a” in the Conditional Formatting Condition…
Anybody know a way around this?

Hello David,

thank you for your post.

Unfortunately, only LL.CurrentValue is available - the displayed content cannot be processed further.

Here it makes sense to pass the data already adapted to List & Label (e.g. via a change in the “AutoDefineField” event)

Best regards,

Patrick Preuschoff
Technical Support
combit GmbH

Hello Patrick,

I use the Conditional Formatting Condition to change the text colour for the cell. Is this possible in the “AutoDefineField” event (unlikely, I think), or is there maybe an event which occurs before the cell is drawn in which I could do this?

Best regards,
David Mackenzie

With the AutoDefineFieldEvent you get the possibility to adjust the data to the desired values before the data is passed to List & Label without having to change the data in your data source. This means that you can specify directly that, for example, “inf” becomes the number 99999999999. This also allows you to use conditional formatting correctly to adjust the text color of the cell accordingly.

1 Like

Thank you Patrick, that made the following solution possible.
In the AutoDefineField event I replace “inf” with “99999” and “n/a” with “100000”.
In the Cell Definition tab, the Value property is now simply a ToNumber() of the field.
The Displayed Contents property converts “99999” back to “inf”.
The Conditional Formatting sets both foreground and background grey (and does “Stop if true”) when LL.CurrentValue == 100000.

The solution is acceptable but not quite perfect.
Firstly, I would have preferred to display “n/a” rather than a grey cell, but LL.CurrentValue is apparently obtained from the Displayed Contents (so would be zero if I were to convert “100000” back to “n/a” there); luckily I don’t need LL.CurrentValue in the case of “inf”.
Secondly, the trick with the grey cell is purely optical, so using a much larger number for “n/a” would increase the column width unnecessarily (I would prefer not to use the “Maximum Width” property).

However, I can live with that and am happy to have a solution, so thanks again.

1 Like

© combit GmbH