Kbase P15432: How to implement jump functionality in WebSpeed Report objects?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  14/10/2004 |
|
Status: Unverified
GOAL:
How to implement jump functionality in WebSpeed Report objects?
FACT(s) (Environment):
Webspeed 3.1x
Webspeed Report objects have navigation and search capabilities so far.
To have the report displaying a page by indicating the page number you need to:
1. add a field for page number and a button to submit the page like:
<FORM name=fjump METHOD=GET>
Pages to Jump
<INPUT TYPE=TEXT NAME=numPages size=5 VALUE="`html-encode(get-field('numPages'))`" >
<input type=submit name=b_jump value=jump>
<INPUT TYPE="hidden" NAME="Navigate" VALUE="Jump">
<INPUT TYPE="text" size=20 NAME="CurrentRowIDs" VALUE="`html-encode(getCurrentRowids())`" >
</FORM>
2. copy src/web2/webrep.p to ./web2/webrep.p and change processWebRequest as follows:
CASE NAVIGATE:
...
WHEN "Jump" THEN DO: /* add this line */
RUN fetchJump IN TARGET-PROCEDURE. /* add this line */
END. /* add this line */
OTHERWISE
RUN fetchCurrent IN TARGET-PROCEDURE.
END CASE.
NOTE: WebSpeed Broker needs to be restarted
3. add fetchJump to your report
PROCEDURE fetchJump:
DEFINE VARIABLE myCurrentRowids AS CHARACTER.
define variable numRows AS INTEGER.
define variable hQuery as handle.
myCurrentRowids = get-field( "CurrentRowIDs" ) .
numRows = getTableRows() * INTEGER( get-field( "numPages" ) ) .
{get QueryHandle hQuery}.
IF myCurrentRowids <> ? THEN
DO:
{set CurrentRowids myCurrentRowids }.
hQuery:REPOSITION-TO-ROWID( TO-ROWID( myCurrentRowids ) ).
hQuery:get-next().
END.
hQuery:REPOSITION-FORWARD(numRows).
IF hQuery:QUERY-OFF-END THEN
DO:
RUN fetchCurrent IN TARGET-PROCEDURE.
END.
ELSE
DO:
hQuery:REPOSITION-BACKWARD(1).
hQuery:GET-NEXT.
END. /* we were off-end */
END PROCEDURE.
NOTE: you need to adapt fetchJump for SDO in case you use one in your report