Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dead looping report....
Message
From
30/12/1999 04:19:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/12/1999 03:00:34
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00310266
Message ID:
00310273
Views:
31
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform