Focal Point
paging in webfocus (but not using webviewer)

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

June 24, 2004, 09:12 PM
<Vipul>
paging in webfocus (but not using webviewer)
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


You can also look at "Bursting Reports Into Multiple HTML Files" chapter 12 of the "Creating Reports with WebFOCUS Language" manual (v5.2).

Regards
Grzegorz

This message has been edited. Last edited by: Kerry,
June 25, 2004, 04:22 PM
susannah
Vipul, are you wanting to page it for Printing??
June 29, 2004, 10:17 PM
<Vipul>
No Susannah,
This was not for printing..but if I can add that feature with the above that will be great.

Thanks,

Vipul
April 08, 2005, 06:27 AM
<We_Focus>
HI

If i want to add a WHERE Condition in it how to do i had try it but it is not working

if any example please help