>My situation now is, i want to print out a report, but each of the report is defined to only contain 10 item, if more than 10 , the rest will go on to the next report. My code is:
> SELECT REPORT_C2
> REC = RECCOUNT()
> TO_PAGENO = 0
> IF REC > 11
> DO WHILE (REC > 11 )
> REC = REC - 10
> TO_PAGENO = TO_PAGENO + 1
> IF REC > 0 AND REC < 11
> TO_PAGENO = TO_PAGENO + 1
> ENDIF
>
> ENDDO
> ELSE
> TO_PAGENO = 1
> ENDIF
> FM_PAGENO = 1
>
> WAIT WINDOW "Printing......." TIMEOUT 3
> FOR PN = FM_PAGENO TO TO_PAGENO
> MESSAGEBOX(STR(PN),0,"TEST")
> IF PN = 1
> NITEM = 0
> TPAGENO = PN
> REPORT FORM SOREPORT TO PRINTER
> ELSE
> NITEM = 10 * (PN - 1)
> TPAGENO = PN
> REPORT FORM SOREPORT TO PRINTER
> ENDIF
> ENDFOR
>ELSE
> MESSAGEBOX("SO No. Not Found!", 0 + 48,"System")
>ENDIF
>
>RETURN
>
>* report_c2 is a cursor contain all the record information for my report and fm_pageno & to_pageno contain the number of page for the "for loop" to print servals report.
Could this work for you ?
SELECT REPORT_C2
scan
WAIT WINDOW "Printing......." nowait
REPORT FORM SOREPORT NEXT 10 TO PRINTER
if !eof()
skip -1
endif
endscan
Cetin