Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] WebFocus 8 - Colorize cell

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] WebFocus 8 - Colorize cell
 Login/Join
 
Member
posted
Hi all,

I display table in which I want colorize cell depends on value which is in it.
I try search but do not found anything.
Does anyone try do something like that?

Maybe this information is important I use 2 levels of across to build this table.

Regards,
Mateusz

This message has been edited. Last edited by: FP Mod Chuck,
 
Posts: 6 | Registered: March 25, 2019Report This Post
Virtuoso
posted Hide Post
1. What version of WebFOCUS are you using? (Very useful info that you should probably put into your Focal Point Signature.)
2. Which authoring tool are you using? (InfoAssist or App Studio)
3. Search the doc for Traffic Light or Conditional Styling. https://infocenter.information...ource%2Ftopic168.htm

4. It's always helpful to provide an example of what you've tried using a WebFOCUS Sample file so we can give you more specific answers.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Member
posted Hide Post
1. I use WebFocus 8.1
2. I developing via App Studio.
3. Thank you for this url. I will look at it.
4. I want receive the following result
 TABLE FILE CAR
SUM
SALES
BY COUNTRY
ACROSS SEATS

ON TABLE SET STYLESHEET *
TYPE=REPORT, ACROSSCOLUMN=SALES, BACKCOLOR=SILVER, WHEN= SEATS EQ 4,$
END  


But using styling from this file:
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

Also I want color cells contain via row, but manual for formating which I found works via column.

Is it possible?
 
Posts: 6 | Registered: March 25, 2019Report This Post
Gold member
posted Hide Post
Hello Mateusz,

Sometimes workarounds are the solution, if you can't immediately determine how to code something directly.

Seeing your question, this coding example comes to mind as a possible solution.

-* pull all the records for the report to a hold file
TABLE FILE CAR
SUM SALES BY COUNTRY BY SEATS
ON TABLE HOLD
END
-* make a hold file to flag for the countries that have 4 seats.
TABLE FILE HOLD
PRINT COUNTRY AS 'FLAGGED'
BY COUNTRY
WHERE SEATS EQ 4
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLD1
END
-* produce the report
JOIN COUNTRY IN HOLD TO COUNTRY IN HOLD1
END
TABLE FILE HOLD
SUM SALES FLAGGED NOPRINT BY COUNTRY
ACROSS SEATS
ON TABLE SET STYLESHEET *
TYPE=REPORT, ACROSSCOLUMN=SALES, BACKCOLOR=SILVER, WHEN=FLAGGED NE ' ',$
END

is this a possible solution until you can determine how to code it directly?


WebFocus 7x, 8x, Win / Linux, any output format
 
Posts: 70 | Location: reading, pa | Registered: April 07, 2007Report This Post
Master
posted Hide Post
quote:
Sometimes workarounds are the solution

Truer words...I've been thinking about writing a book called 1001 IBI workarounds


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by Mateusz:
1. I use WebFocus 8.1
2. I developing via App Studio.
3. Thank you for this url. I will look at it.
4. I want receive the following result
 TABLE FILE CAR
SUM
SALES
BY COUNTRY
ACROSS SEATS

ON TABLE SET STYLESHEET *
TYPE=REPORT, ACROSSCOLUMN=SALES, BACKCOLOR=SILVER, WHEN= SEATS EQ 4,$
END  


But using styling from this file:
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,

Also I want color cells contain via row, but manual for formating which I found works via column.

Is it possible?


Is this what you are looking for?
  
TABLE FILE CAR
SUM 
    CAR.BODY.SALES
BY  CAR.ORIGIN.COUNTRY
ACROSS CAR.BODY.SEATS
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE SET ASNAMES ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLEMBEDIMG ON
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
     DEFMACRO=COND0001,
     MACTYPE=RULE,
     WHEN=A1 EQ 4,
$
TYPE=DATA,
     ACROSSCOLUMN=N1,
     BACKCOLOR='SILVER',
     MACRO=COND0001,
$
ENDSTYLE
END


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Member
posted Hide Post
Hi all,

Thank you very much for answers and your help.
Unfortunately, my business case is unusual.

Yes - I can confirm - workaround is the solution ; - )

The javascrpt call resolve my issue,
because values are defined via rows - not columns.

This is code which do the job:
 
-HTMLFORM BEGIN
<HTML>
	<script type="text/javascript">
		var body = document.getElementsByTagName('body')[0];
		var table = document.getElementsByTagName('table')[0];

		// colors
		var green = 'rgba(0, 176, 80, 1)';
		var light_green = 'rgb(228,242,239)';
		var yellow = 'rgba(255, 255, 0, 1)';
		var orange = 'rgb(249,178,88)';
		var dark_orange = 'rgba(255, 192, 0, 1)';
		var red = 'rgb(252,0,25)';

		function f1(row) {
			for (var i=1; i<row.length-1; i++) {
				if (parseInt(row[i].innerText) >= 0 && parseInt(row[i].innerText) <= 14) {
					row[i].style.backgroundColor = green; // green
				} else {
					row[i].style.backgroundColor = red; // red
				}
			}
		}

		function f2(row) {
			for (var i=1; i<row.length-1; i++) {
				if (parseInt(row[i].innerText) >= 0 && parseInt(row[i].innerText) <= 4) {
					row[i].style.backgroundColor = green; // green
				} else if (parseInt(row[i].innerText) >= 5 && parseInt(row[i].innerText) <= 9) {
					row[i].style.backgroundColor = yellow; // yellow
				} else {
					row[i].style.backgroundColor = red; // red
				}
			}
		}

		if (table) {
			var rows = table.children[0].children;

			for (var i=4; i<rows.length-2; i++) {

				switch(i) {
				
					case 4:
						// f1
						f1(rows[i].cells);
					break;

					case 5:
						// f2
						f2(rows[i].cells);
					break;

					default:
						console.log('default');

				}
			}
		}
	</script>


</HTML>

-HTMLFORM END

-RUN 
 
Posts: 6 | Registered: March 25, 2019Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] WebFocus 8 - Colorize cell

Copyright © 1996-2020 Information Builders