Hi,
I want to change the font based on a condition.
e.g.
If value is a header
description = bold
Else
description = standard
Is this possible? Styles seem to be only applied to the whole element and there's no place for logic.
Thanks.
|
|
Conditional formattingModerators: Snowy, thx4allthefish, YuriT, Gothmog
6 posts • Page 1 of 1
Conditional formattingHi,
I want to change the font based on a condition. e.g. If value is a header description = bold Else description = standard Is this possible? Styles seem to be only applied to the whole element and there's no place for logic. Thanks.
Re: Conditional formattingSome additional precisions could help.
Where do you want to do that ?
Re: Conditional formattingIn a smartform. Specifically, it's a variable in a table cell.
Re: Conditional formatting
Styles define what paragraph and character formats you can use. Only one style per text element, but you can use different character formats inside this text element. I guess your 'if value is header' condition is misleading, since the table header is distinct form the table main area, so it would be different cells, and text elements. However, if you want to change the character format depending on a condition, output different text elements (with different character formats) depending on an Alternative node. (I'm not sure I quite understand your question, so sorry if I'm not addressing your problem.)
Re: Conditional formattingHi
Yes sorry if I'm not being clear. I'm outputting a variable (it doesn't have to be in a table, just for my example it's in a cell). So in the Text element, I have &wa_var& I can define the style in a number of places: for example by selecting the Paragraph Format in the Text element, or further up the hierarchy by entering a style on the Cell element, or further up still by entering a style on the Row element, and so on. In sapscript, the code would have looked something like this: /: if field = "H". Z1 &wa_var& /: else. Z2 &wa_var& "<-- notice the different formatting Hopefully this is clearer!! Thanks for your help so far!
Re: Conditional formattingI'd use an Alternative node, then, and output a different text element depending on the condition.
You can set these text elements to 'Start : Append directly' (in the general attributes) if you want to do that inside a text line.
6 posts • Page 1 of 1
Return to SAPscript/Smartforms Who is onlineUsers browsing this forum: No registered users and 2 guests |
|