General information
Category:
Reports & Report designer
Title:
Dead looping report....
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.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only