Is there a way to simulate paging in webfocus but not by using webviewer?
Thanks,
Vipul
June 25, 2004, 08:04 AM
<Grzegorz>
Vipul,
There are many ways (as usual in WebFOCUS). You can use DM "macros", mix the FOCUS with HTML and JavaScript, etc. A very simple and rough example:
-* paging.fex:
-DEFAULTS &PG=1;
TABLE FILE CAR
PRINT SALES
BY COUNTRY
ON TABLE HOLD
END
DEFINE FILE HOLD
PAGE/I8 = IF COUNTRY NE LAST COUNTRY THEN PAGE+1 ELSE PAGE;
END
-RUN
TABLE FILE HOLD
ON TABLE SET PAGE-NUM OFF
PRINT SALES
BY COUNTRY
WHERE PAGE EQ &PG
ON TABLE HOLD AS CARRPT FORMAT HTMTABLE
END
-HTMLFORM BEGIN
<html>
<head><title>WebFOCUS Report with paging</title>
<script type="text/javascript">
function runrep(direction) {
var frm = document.WForm;
if (direction == 'prev') frm.PG.value--;
if (direction == 'next') frm.PG.value++;
frm.submit();
}
</script>
</head>
<body>
<form name="WForm" action="/ibi_apps/WFServlet" method="get">
<input type="hidden" name="IBIAPP_app" value="test"/>
<input type="hidden" name="IBIF_ex" value="paging"/>
<input type="hidden" name="PG" value="&PG|";
<table>
<tr>
<td colspan="2">!IBI.FIL.CARRPT;</td>
</tr>
<tr>
<td><input type="button" value="<<" onclick="runrep['prev')"/></td>
<td><input type="button" value=">>" onclick="runrep('next')"/></td>
</tr>
</table>
</form>
</body>
</html>
-HTMLFORM END