Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Want to skip records
Message
From
29/11/2006 11:54:48
Rebecca Stottlemire
Kansas State Department of Commerce
Topeka, Kansas, United States
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Network:
Windows 2000 Server
Miscellaneous
Thread ID:
01173254
Message ID:
01173346
Views:
11
>>I am doing a report in which I want to list only the first 15 records in each grouping, not the whole file.
>>
>>I put in a counter and asked it to print when the counter is < 16, but it's printing the first 15 then leaving blank lines for all the rest (100's of blank pages). I have the no print when empty checked, but that doesn't do it.
>>
>>Is there a way to get it to quit after 15 and go to the next category?
>>
>>Thanks,
>>Rebecca
>
>Seems like you'll need to do in procedural code:
>
>Hopefully the table is ordered by some key withing group-code key, or you can first SQL select the data INTO his order.
>Then in a scan loop, with item-within-group counter 1-15, successively add the required recs to another table/cursor, and use this for the report.


Just FYI, here's how it got it to work. This may not be the best way, but it works well for my purposes:
SELECT "N" as keep, a.office, a.error_num, a.ind_ident, a.ssno, a.part_date, a.data, b.message, c.file, c.val_date, c.valid_id from valerrors a, val_codes b, vallog c WHERE a.error_num = b.error_num AND a.valid_id = lnvalid_id AND c.valid_id = lnvalid_id ORDER BY a.office,; a.error_num, a.ind_ident INTO dbf temp
IF _TALLY > 0
SELECT DISTINCT office, error_num FROM temp INTO ARRAY errornumbers
FOR lnacounter = 1 TO ALEN(errornumbers,1)
     lnerrorcounter = 1
     SELECT temp
     GO TOP
     SCAN
          IF lnerrorcounter = 15 OR EOF()
               EXIT
          ELSE
		IF office = errornumbers(lnacounter,1) AND
                error_num = errornumbers(lnacounter,2)
			lnerrorcounter = lnerrorcounter + 1
			REPLACE keep WITH "Y"
		ENDIF
          ENDIF	
     ENDSCAN
ENDFOR
SELECT temp
DELETE FOR keep = "N"
Previous
Reply
Map
View

Click here to load this message in the networking platform