on 01-06-2015 5:21 PM
I am trying to conditionally format a crosstab. I am using a HANA datasource.
There is an article that says the query could return a value, such as:<circle></circle><alert1>4290</alert1>. Then CSS could be used to format the cell that contains the value.
In the HTML, it creates this:
<circle></circle><alert1>4290</alert1>,
However, when I copy it, I get this (maybe the same?)
<div id="__cell6_contentDiv" tabindex="-1" class="sapzencrosstab-HeaderCellContentDiv" style="width: 207px;"><circle></circle><alert1>4290</alert1></div>
The article, then states that CSS could be used to format the data. However, the crosstab simply shows: <circle></circle><alert1>4290</alert1>
Has anybody successfully used conditional formatting on a crosstab, not using a BEx query? Or, have any ideas how to make an idea like the one above work?
Link to article: http://just-bi.nl/design-studio-conditional-formatting-on-sap-hana/
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Victor's article is nice, as it gives the CSS for the different alerter icons. But, I am unsure how to apply CSS formatting to individual cells in a crosstab.
The article that I started this thread with tried to embed the CSS tags in the value from the query: <alert1>4290</alert1>. This seems really promising, but I need it to be read as HTML and not a literal string.
The copied HTML form Chrome shows:
<div id="__cell6_contentDiv" tabindex="-1" class="sapzencrosstab-HeaderCellContentDiv" style="width: 207px;">
<circle></circle><alert1>4290</alert1>
</div>
I am guessing that Design Studio converted the < and > to < and >, so that they will not be interpreted as HTML tags. If I could use some kind of escape sequence to tell Design Studio to use the < and > characters, then I think that it would work. I tried \< and \>, but it did not work.
Hi Tammy,
Thanks again.
This article describes how to highlight particular rows in a crosstab. For example, the total row. Each of these rows have different HTML tags, so the CSS can easily be applied to the row.
I need to highlight a row based on a value in the row. For example, all rows with year 2014, I want to highlight yellow. In Web Intelligence, I would just use conditional formatting, such as if <Year> = 2014, then background is light yellow.
I want to do this in Design Studio.
I don't think that either of these methods are feasible in the current version.
Hi Tammy,
Thank you.
I believe that the crosstab component in Design Studio is using the JQuery function text to output the values in their respected divs. For example, $().text('<alert>2015</alert>'), which will output exactly what is in the argument: <alert>2015</alert>.
If they could create the same crosstab component, and call it HTML Formatted Crosstab, and simply replace the $().text with $().html, then it would work. For example, $().html('<alert>2015</alert>'), would output: 2015. Then if there was a CSS definition for alert (custom CSS file), such as alert { .background-color: #00ff00; }, then the background color of the cell would be green.
I have seen the simpletable custom control, but I think that it would be a bigger exercise to create such a custom component. Would be good if the Design Studio team could create the alternate crosstab component that uses $().html instead of $().text. This would allow us to insert our own HTML tags on our data, and define css definitions for the tags.
For example,
Data:
customer year ...
Customer 2 <green>2015</green>
Customer 3 <blue>2014</blue>
Customer 4 <green>2015</green>
Custom CSS:
green{
background-color: #00ff00;
}
blue{
background-color: #0000ff;
}
Robert - it might be worth submitting this as an Idea to Idea Place - see https://ideas.sap.com/SBODesignStudio
There are two related ideas for you to also consider supporting:
Tammy
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.