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] Background color flashing

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[solved] Background color flashing
 Login/Join
 
Platinum Member
posted
Hello

Below is the sample code with CAR.
Is there a way to change background color of SALES like its flashing, basically two background colors at a specific interval?
   
TABLE FILE CAR
SUM
SALES
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
$
TYPE=REPORT, GRID=ON, $
ENDSTYLE
END   


I found some ways to do in HTML but its working behind whole table but not a cell or column.
Please suggest.
Thanks.

This message has been edited. Last edited by: BI_Developer,


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report This Post
Master
posted Hide Post
By allowing WebFOCUS to build the html table for you, there are no identifiers. So unfortunately not like this you can't.

However, if you build your own html tables, then you would be able to.

Example:
DEFINE FILE CAR
TDCOL/A255=IF COUNTRY EQ 'ENGLAND' THEN '<td style="background-image: url(\"flashing_image.gif\")">' ELSE '<td>';
END

TABLE FILE CAR
SUM
SALES
TDCOL
BY COUNTRY
-*WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE HOLD AS MYHOLD FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=ON, $
ENDSTYLE
END  

-RUN
-HTMLFORM BEGIN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<body>

<table border cellpadding=1>
-REPEAT HENDNUM FOR &COUNTER FROM 1 TO &LINES
-READFILE MYHOLD
<tr>
	<td>
		!IBI.AMP.COUNTRY;
	</td>
	!IBI.AMP.TDCOL;
		!IBI.AMP.SALES;
	</td>
</tr>
-HENDNUM
-ENDLOOP
</table>

</body>
</html>
-HTMLFORM END



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
Yes. It's really the easist way to get animation. There is a way to use JavaScript and have it on a timer and change the background color, but there is no quick way to tell it how to keep track of what TD to change the colors on. You would have to have multiple functions, but I figured it might be a bit more complex to go that route. The url() will allow a full path to the image. So it can really sit anywhere.

You can create two images, the two colors you want, use this website to generate you an animated gif.
http://makeagif.com/pictures-to-gif

I've never used the website above, I just googled it.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
Place the image in the same folder as the Fex. Then through the web console, right click on the image and say "View". It should give you a URL. Remove just the domain and port leaving the "/" at the beginning. This should be the URL you use for the image.

Example, mine looks like this:
/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_RUN&BIP_folder=IBFS%253A%252FWFC%252FRepository%252FTesting&BIP_item=flash.gif&IBI_random=4744.596621021628



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Platinum Member
posted Hide Post
I provided the full URL and its working. thanks a lot for the solution.
quote:
Originally posted by GavinL:
Place the image in the same folder as the Fex. Then through the web console, right click on the image and say "View". It should give you a URL. Remove just the domain and port leaving the "/" at the beginning. This should be the URL you use for the image.

Example, mine looks like this:
/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_RUN&BIP_folder=IBFS%253A%252FWFC%252FRepository%252FTesting&BIP_item=flash.gif&IBI_random=4744.596621021628


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report This Post
Master
posted Hide Post
Here is my exact code.. I made a change, which may help you. I've removed the double quotes around the URL. This will work as long as you change the URL to yours.

NOTE: URL's have Amps, you must replace them with AMP BAR, "&|" because they will be treated as variables if you don't.

DEFINE FILE CAR
TDCOL/A255=IF COUNTRY EQ 'ENGLAND' THEN '<td style="background-color: #c0c0c0; background-image: url(/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_RUN&|BIP_folder=IBFS%253A%252FWFC%252FRepository%252FTesting&|BIP_item=flash.gif&|IBI_random=4691.633330658078)">' ELSE '<td>';
END

TABLE FILE CAR
SUM
SALES
TDCOL
BY COUNTRY
-*WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE HOLD AS MYHOLD FORMAT ALPHA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=REPORT, GRID=ON, $
ENDSTYLE
END

-RUN
-HTMLFORM BEGIN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"  "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<body>

<table border cellpadding=1>
-REPEAT HENDNUM FOR &COUNTER FROM 1 TO &LINES
-READFILE MYHOLD
<tr>
	<td>
		!IBI.AMP.COUNTRY;
	</td>
	!IBI.AMP.TDCOL;
		!IBI.AMP.SALES;
	</td>
</tr>
-HENDNUM
-ENDLOOP
</table>

</body>
</html>
-HTMLFORM END



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Platinum Member
posted Hide Post
Gavin, this code worked for my initial test.
But lets assume a well formatted report with drill downs done in FOCUS. As output is stored in ALPHA format, we loose all that formatting along with column titles. Any way to have this? Or the only way is to recreate again in HTML code?
quote:
Originally posted by GavinL:
Place the image in the same folder as the Fex. Then through the web console, right click on the image and say "View". It should give you a URL. Remove just the domain and port leaving the "/" at the beginning. This should be the URL you use for the image.

Example, mine looks like this:
/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_RUN&BIP_folder=IBFS%253A%252FWFC%252FRepository%252FTesting&BIP_item=flash.gif&IBI_random=4744.596621021628


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report This Post
Master
posted Hide Post
quote:
...Is there a way to change background color of SALES like its flashing, basically two background colors at a specific interval?...

How about something like this?
-* File blinkingbackground.fex
-*
-* Step 1: Create HTML Report.  
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE HOLD AS MYREPT FORMAT HTMTABLE
ON TABLE SET STYLE *
 INCLUDE = endeflt, $
 TYPE=REPORT, SIZE=12,$
 TYPE=DATA, COLUMN=SALES, CLASS=clsSalesColumn,$
ENDSTYLE
END
-RUN
-*
-* Step 2: Report Presentation.  
-*
-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
 blinkBackground();
});
 
function blinkBackground() {
 $(".clsSalesColumn").css('background-color', 'red');
 setTimeout("setblinkBackground()",1000)
 }

function setblinkBackground() {
 $(".clsSalesColumn").css('background-color', 'green');
 setTimeout("blinkBackground()",1000)
 }
</script>
</head>
<body>
 !IBI.FIL.MYREPT;
</body>
</html>
-HTMLFORM END   

Giving...




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
 
Posts: 822 | Registered: April 23, 2003Report This Post
Master
posted Hide Post
You all know this would drive the 508 compliant maniacs crazy, right?


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Master
posted Hide Post
quote:
<script>
$(document).ready(function(){
blinkBackground();
});

function blinkBackground() {
$(".clsSalesColumn").css('background-color', 'red');
setTimeout("setblinkBackground()",1000)
}

function setblinkBackground() {
$(".clsSalesColumn").css('background-color', 'green');
setTimeout("blinkBackground()",1000)
}



There is the JavaScript that I thought might be a bit more complex... Will work for your situation as well.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
David, I don't know why, but when I try your example, the class name is always x2, not clsSalesColumn like specified.

I've altered David's code little bit.. This way there can be more than one result and still alert. I also removed all JQuery, as I'm not a fan of large libraries of code executing for 3 lines needed. Yea it's simpler to the developer, but your taking a hit for that.

TABLE FILE CAR
SUM
	SALES
	COMPUTE TOTSALES/I9=SUM.SALES; NOPRINT
BY COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, CLASS=x2, WHEN=TOTSALES GE 70000, $
TYPE=REPORT, GRID=ON, $
ENDSTYLE
END

-RUN
-*
-* Step 2: Report Presentation.  
-*
-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<script>
{
	 blinkRedBackground();
}
 
function blinkRedBackground() {
	var x = document.getElementsByClassName("x2");
	for (var i = 0; i < x.length; i++) {
	    x[i].style.backgroundColor = "red";
	}
	setTimeout("blinkGreenBackground()",1000)
}

function blinkGreenBackground() {
	var x = document.getElementsByClassName("x2");
	for (var i = 0; i < x.length; i++) {
	    x[i].style.backgroundColor = "green";
	}
	setTimeout("blinkRedBackground()",1000)
}
</script>
</head>

</html>
-HTMLFORM END



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Master
posted Hide Post
quote:
when I try your example, the class name is always x2, not clsSalesColumn like specified.

Are you running while asking WebFOCUS to create an internal Cascading Style Sheet, that is, HTMLCSS parameter = ON?
 
Posts: 822 | Registered: April 23, 2003Report This Post
Platinum Member
posted Hide Post
David

This worked awesome. As format is HTMTABLE, its retaining all the styling and drill downs etc.
Thanks a lot.

quote:
Originally posted by David Briars:
quote:
...Is there a way to change background color of SALES like its flashing, basically two background colors at a specific interval?...

How about something like this?
-* File blinkingbackground.fex
-*
-* Step 1: Create HTML Report.  
-*
TABLE FILE CAR
SUM SALES
BY COUNTRY
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE HOLD AS MYREPT FORMAT HTMTABLE
ON TABLE SET STYLE *
 INCLUDE = endeflt, $
 TYPE=REPORT, SIZE=12,$
 TYPE=DATA, COLUMN=SALES, CLASS=clsSalesColumn,$
ENDSTYLE
END
-RUN
-*
-* Step 2: Report Presentation.  
-*
-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
 blinkBackground();
});
 
function blinkBackground() {
 $(".clsSalesColumn").css('background-color', 'red');
 setTimeout("setblinkBackground()",1000)
 }

function setblinkBackground() {
 $(".clsSalesColumn").css('background-color', 'green');
 setTimeout("blinkBackground()",1000)
 }
</script>
</head>
<body>
 !IBI.FIL.MYREPT;
</body>
</html>
-HTMLFORM END   

Giving...


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report This Post
Master
posted Hide Post
quote:
Are you running while asking WebFOCUS to create an internal Cascading Style Sheet, that is, HTMLCSS parameter = ON?


yea, missed that.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Platinum Member
posted Hide Post
quote:
Originally posted by David Briars:
quote:
when I try your example, the class name is always x2, not clsSalesColumn like specified.

Are you running while asking WebFOCUS to create an internal Cascading Style Sheet, that is, HTMLCSS parameter = ON?


I think 508 compliance craziness is true. This is not working with Chrome.


WF 8.2.01 APP STUDIO
PDF,HTML,EXL2K,Active
 
Posts: 139 | Registered: July 21, 2011Report This Post
Master
posted Hide Post
I only use Chrome and it works for me. Using v43.0.2357.81

Code, I'm using..

TABLE FILE CAR
SUM
	SALES
BY COUNTRY
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE HOLD AS MYREPT FORMAT HTMTABLE
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, CLASS=clsSalesColumn, WHEN=SALES GE 70000, $
TYPE=REPORT, GRID=ON, $
ENDSTYLE
END

-RUN
-*
-* Step 2: Report Presentation.
-*
-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<script src="/ibi_apps/jquery/jquery_min.js"></script>
<script>
$(document).ready(function(){
	blinkBackground();
});
 
function blinkBackground() {
	$(".clsSalesColumn").css('background-color', 'red');
	setTimeout("setblinkBackground()",1000)
}

function setblinkBackground() {
	$(".clsSalesColumn").css('background-color', 'green');
	setTimeout("blinkBackground()",1000)
}
</script>
</head>
<body>
	!IBI.FIL.MYREPT;
</body>
</html>
-HTMLFORM END

This message has been edited. Last edited by: GavinL,



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report 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] Background color flashing

Copyright © 1996-2020 Information Builders