Prodataset

Posted by atuldalvi123 on 21-Jan-2016 12:59

How do I limit the no of display records in browser using prodataset ?

I want to return and display next available 10 records on click of button.

I am writing program like below but its not completed yet. 

Is there any prodataset property or method available to limit the display records in browser ?

DEFINE TEMP-TABLE tt_procm
FIELD lice_id LIKE ProcMain.lice_id
FIELD proc_id LIKE ProcMain.proc_id
.

DEFINE VARIABLE hObj AS HANDLE NO-UNDO.

DEFINE QUERY q1 FOR ProcMain. 
DEFINE QUERY q2 FOR tt_procm. 

DEFINE BROWSE b1 QUERY q2 DISPLAY tt_procm.lice_id tt_procm.proc_id 
WITH 10 DOWN TITLE "ProcMain Browse". 

DEFINE BUTTON btnNext LABEL "Next".

DEFINE FRAME f1 b1 btnNext
WITH SIDE-LABELS AT ROW 2 COLUMN 2. 

DEFINE DATASET DsProcm FOR tt_procm.
DEFINE DATA-SOURCE DsrProcm FOR QUERY q1.

hObj = DATASET DsProcm:HANDLE.

BUFFER tt_procm:ATTACH-DATA-SOURCE(DATA-SOURCE DsrProcm:HANDLE).

RUN proc_getrecords.

ENABLE b1 btnNext WITH FRAME f1. 

/* Button trigger */
ON 'choose':U OF btnNext
DO:
RETURN.
END.

WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

PROCEDURE proc_getrecords:

DATASET DsProcm:EMPTY-DATASET.
EMPTY TEMP-TABLE tt_procm.

QUERY q1:QUERY-PREPARE("FOR EACH procmain no-lock").
hObj:FILL().

OPEN QUERY q2 FOR EACH tt_procm. 

END PROCEDURE.

 

All Replies

Posted by Peter Judge on 21-Jan-2016 13:22

There are properties to help you control the batch size (which is, I think, what you're after). This will add n records at a time to the dataset. The browser just shows what's in the dataset.
 

Posted by Maghrabi on 22-Jan-2016 01:12

Try by using the BATCH-SIZE attribute of your ProDataSet.

Posted by atuldalvi123 on 22-Jan-2016 02:08

Ya its working internally, thanks. Now I want to separate my logic in another .p that will be like appserver .p and want to pass dataset as a input output parameter and perform calculation.

Instead of temp table i have to attach dataset directly to the browser, is that possible ?

This thread is closed