Re: page 1 of x in 4gl reports ???
Posted in 1996
In article <01bb9520$a51db420$160241c2@mndscs00.minimal.pt>, Carlos Costa e Silva <ccs@minimal.pt (Carlos Costa e Silva)> wrote: > >When really necessary, the way we do it is to write the >output lines into a temp table and then read the table and >create the report. > >ccs. > >-- >Carlos Costa e Silva >ccs@minimal.pt > Another way is to use the "order by" in the report function. Parameters to the report function would include an approriate number of values used to control the ordering on the report. Either separate values or a record structure. report smprpt(groupid, groupcount, lineId, colId, str) order by groupId, groupCount, lineId, colId OR report smprpt (controlData, sortKey, reportData) controlData record end controlData, order by sortKey Letting the report function order the data you send it saves a lot of work. Generate values during the processing and assembly of data such that you can send the number of records on the page and number of records in the whole report LAST and have the report sort it to the top. using the usual BEFORE/AFTER stuff you can get what you need before you start printing the details. Thinking SMALL is sometimes better. In the first report example the data in "str" is actually PREFORMATTED data that is done in numerous subroutines. The lineId and colId actually direct the report function on where to put the data on the page. lineId might be a serial value that you generate yourself as you process records through a foreach loop. I have used this technique to generate reports that are basically spreadsheet looking things that grow dynamically both horizontally and vertically. This technique also works well for "multi-line" reports where the group data appears on first line and detail data appears in columns on subsequent lines. -- Michael J. Kuhn Computer Systems Consultant phone:410-254-7060 Email: mkuhn@csd.clark.net, csd@clark.net mkuhn@rhlab.com c/o Baltimore Rh Typing Laboratory, Inc. phone:410-225-9595