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.
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,
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
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.
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
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
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
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
...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
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
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
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