cancel
Showing results for 
Search instead for 
Did you mean: 

Design Studio conditional formatting on SAP HANA

0 Kudos

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;">&lt;circle&gt;&lt;/circle&gt;&lt;alert1&gt;4290&lt;/alert1&gt;</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.

Accepted Solutions (0)

Answers (1)

Answers (1)

TammyPowlas
Active Contributor
0 Kudos

Robert - could you try this to set up conditional formatting instead:

It might be easier than CSS

0 Kudos

Hi Tammy,

I read this and was happy to see it for charts. I do not see how to use this with cross tables?

Thanks.

TammyPowlas
Active Contributor
0 Kudos

You're right about that

Victor has a nice document here:

Another easy way is to go from Analysis Office (which could use HANA as data source)

Also see

0 Kudos

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;">

   &lt;circle&gt;&lt;/circle&gt;&lt;alert1&gt;4290&lt;/alert1&gt;

</div>

I am guessing that Design Studio converted the < and > to &lt; and &gt;, 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.

TammyPowlas
Active Contributor
0 Kudos

I am not sure how you want to format the crosstab, but David has a nice blog on CSS options

Also see

Also see where he has answered several CSS questions related to Design Studio

0 Kudos

Hi Tammy,

Thank you for all your help. I need to restate the original question:

  • In a crosstab, I need to highlight year 2014 rows yellow and 2015 rows green.
  • I am not using BEx or Analysis for Office.
  • I am using a HANA query hosted on a SAP BI Server.

Is this possible?

TammyPowlas
Active Contributor
0 Kudos

Yes; without knowing the format of your crosstab, please see answer here:

0 Kudos

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.

  • If the rows containing the year 2014 had different class names than the rows with 2015, then I could use the Design Studio 1.4 CSS colors in Crosstab article.
  • If I could embed the HTML tags in the column value (<2014>field1</2014>), then I could also apply an highlight.

I don't think that either of these methods are feasible in the current version.

TammyPowlas
Active Contributor
0 Kudos

I sense that the reply from Victor on this thread may be right as of now for cross tab conditional formatting on HANA - - you can't define the exceptions in Design Studio

0 Kudos

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;

}

TammyPowlas
Active Contributor
0 Kudos

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:

https://ideas.sap.com/D20182

https://ideas.sap.com/D21688

Tammy

0 Kudos

Robert, did you have any luck with this? Seems to be a common problem for a lot of people on here. I wish the DS team would address this and make it simpler