Focal Point
Switch Between Graph and Tabular Data

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3221048071

June 06, 2006, 11:54 AM
ryan ferguson
Switch Between Graph and Tabular Data
Does anybody know of a good way to allow the user to easily switch back and forth between a graph and a tabular report representing the same data. I'm thinking of a button that can switch from the graph to a tabular representation of the data.

Thanks in advance
June 06, 2006, 06:14 PM
paulburridge
Ryan,

I found this in my toolbox. I've not used it myself but it seems to be what you are looking for. It switches between two reports but I'm sure that you can adapt it to your needs.

-* File switch.fex
-* This fex creates 2 reports.
-* To save time recreating the hold file for the numbers report,
-* I've created an html file (switch.htm) where both reports are send to, but
-* only one is shown at a time. Through a javascript one can switch
-* between the two.

TABLE FILE CAR
SUM SALES
BY COUNTRY
ON TABLE HOLD AS SLS_CTY FORMAT HTMTABLE
END

TABLE FILE CAR
SUM SALES
BY CAR
ON TABLE HOLD AS SLS_CAR FORMAT HTMTABLE
END
-RUN

-HTMLFORM SWITCH


<html>
<head>
<title></title>
</head>
<style>
table {
font-family : verdana, arial, sans-serif;
font-size : 9 pt;
line-height : 12pt;
}
body {
font-family : verdana, arial, sans-serif;
font-size : 9 pt;
line-height : 12pt;
}
.table1 {
position : absolute;
}
.table2 {
position : absolute;
visibility : hidden;
}
.btnSwitch {
position : 500;
}
</style>
<script>
var activeReport = 1;
function showTable() {
eval('report' + activeReport + '.style.visibility = "hidden"');
activeReport = (activeReport == 1) ? 2 : 1;
eval('report' + activeReport + '.style.visibility = "visible"');

btnText = (activeReport == 1) ? 'To numbers' : 'To percentages';
document.all("btnSwitch").value = btnText;
}
</script>
</head>
<body>
<table><tr><td>
<input type=button class=btnSwitch onClick=showTable() value='To numbers' name='btnSwitch'> <br><br>
</td><td>
<span class=table1 id=report1>
!IBI.FIL.SLS_CTY;
</span>

<span class=table2 id=report2>
!IBI.FIL.SLS_CAR;
</span>
</td></tr></table>
</body>
</html>


Success,
Paul


Paul Burridge
Senior Consultant
34 years with Information Builders
WebFOCUS 8.2.5 Win10
June 07, 2006, 09:30 AM
Prarie
That is nice....


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Thanks Paul, that worked perfectly!