Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Never print the last line!!!
Message
From
26/01/1997 02:35:15
Kevin Wang
Ministry of Water Resources
Beijing, China
 
 
To
25/01/1997 14:27:35
General information
Forum:
Visual FoxPro
Category:
User groups
Miscellaneous
Thread ID:
00018383
Message ID:
00018424
Views:
37
>I tried your code and it's working on my computer and with other dbf. It's a long time since I wrote the last time a report "by hand", but:
>1. Put a SET PRINTER ON after SET PRINTER TO...
>2. Put a SET PRINTER OFF before SET DEVICE TO SCREEN
>3. You have ")" with no corresponding "(" in:
>do while line_no<=2*max_line_num+5). FoxPro doesn't see these errors all the time, but it acts weird when you have something like that.
>
> 4. Why don't you use the Report Designer?
>
>Vlad

Thank you! I create a button named 'Print' and put my program into its' click event. I run the form and click the button but the printer print nothing, until I click the button again the printer begin to print it and finish it successful with two copies of my table.
So, if I want to print my table I must run my print program twice and it print two copies of my table. I only want it print one copy of my table with click the 'Print' button ONCE! not twice!!! can you help me?

Thanks in avidance


kevin








>
>
>>My eviroment is VFP3.0. I use an program file(.prg) to
>>finish my printing work. the whole file is here:
>>
>>*******  BEGIN  *************
>>SET COMPATIBLE OFF
>>SET DEVICE TO PRINTER
>>SET PRINTER TO LPT1
>>??? CHR(27)+CHR(48)
>>??? CHR(27)+CHR(67)+CHR(68)
>>??? chr(27)+chr(14)
>>
>>IF !USED(sq_bq)
>>  USE sq_bq
>> ELSE
>>  select sq_bq
>>ENDIF
>>
>>max_line_NUM=20
>>page_no=1
>>go top
>>do while .not.eof()
>>    line_no=6
>>        @2,0  say                "                                          ·ç  ±©  ³±  ±í"
>>        @4,0  say                "©°©¤©¤©¤©¤©Ð©¤©¤©¤©¤©Ð©¤©¤©¤©¤©Ð©¤©¤©¤©Ð©¤©¤©¤©Ð©¤©¤©¤©¤©¤©¤©Ð©¤©¤©¤©Ð©¤©¤©¤©Ð©¤©¤©¤©¤©Ð©¤©¤©¤©¤©´"
>>        @5,0  say                "©¦ Õ¾  ºÅ ©¦ Õ¾  Ãû ©¦ ºÓ  Ãû ©¦  Ê¡  ©¦µØ¡¢ÊЩ¦  ʱ    ¼ä  ©¦ ³±Î» ©¦ Æøѹ ©¦ÈÕ¾ù¸ß³±©¦ÈÕ¾ùµÍ³±©¦"
>>    do while line_no<=2*max_line_num+5)
>>        if eof()
>>            @line_no,0   say     "©À©¤©¤©¤©¤©à©¤©¤©¤©¤©à©¤©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©¤©à©¤©¤©¤©¤©È"
>>            @line_no+1,0 say     "©¦        ©¦        ©¦        ©¦      ©¦      ©¦            ©¦      ©¦      ©¦        ©¦        ©¦"
>>        else
>>            @line_no,0 say       "©À©¤©¤©¤©¤©à©¤©¤©¤©¤©à©¤©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©à©¤©¤©¤©¤©à©¤©¤©¤©¤©È"
>>            @line_no+1,0 say     "©¦"+stcd+"©¦" +zm+ "©¦" +hl+ "©¦"+sm+"©¦"+dd+"©¦" +ymdhm+"©¦"+str(zt,6,3)+"©¦"+str(p,6)+"©¦"+str(dayhz,8,3)+"©¦"+str(daylz,8,3)+"©¦"
>>        endif
>>        line_no=line_no+2
>>        if .not.eof()
>>            skip
>>        endif
>>    enddo
>>    @line_no,0 say               "©¸©¤©¤©¤©¤©Ø©¤©¤©¤©¤©Ø©¤©¤©¤©¤©Ø©¤©¤©¤©Ø©¤©¤©¤©Ø©¤©¤©¤©¤©¤©¤©Ø©¤©¤©¤©Ø©¤©¤©¤©Ø©¤©¤©¤©¤©Ø©¤©¤©¤©¤©¼"
>>    @line_no+1,60 say "µÚ"+str(page_no,2)+"Ò³"
>>    page_no=page_no+1
>>    eject page
>>enddo
>>??? CHR(27)+CHR(64)
>>SET DEVICE TO SCREEN
>>SET COMPATIBLE ON
>>CLEAR
>>RETURN
>>***************  THE END   ********************
>>
>>When I run the program, the printer begin to print the table,but it never print the last line and the page number of the last page. So the report is not entire! I don't know how to solve the problem.
>> wait your help.
Kevin Wang

Programmer&Analyst
Ministry of Water Resources
No.1,Baiguang Road
Beijing,China
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform