Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print to a file
Message
 
 
To
16/01/2003 07:29:43
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00742189
Message ID:
00742321
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
The PRINT TO < file name > command affects only output generated by ?/?? commands. You can print to a temp file and than append result to your cumulative file.
lcBigFile = "..."
lcTempFile = ADDBS(SYS(2023)) + SYS(2015) + ".tmp" 
REPORT FORM ... TO FILE (lcTempFile) ASCII

* If files are not to big
STRTOFILE( FILETOSTR(lcBigFile) + FILETOSTR(lcTempFile), lcBigFile, .T.)

* otherwise you can use LLFF
lnFH1 = FOPEN(lcBigFile,12)
* Move pointer to the end of the file
= FSEEK(lnFH1, 0, 2)
* Open second file
lnFH2 = FOPEN(lcTempFile)
DO WHILE NOT FEOF(lnFH2)
   lcBuffer = FREAD(lnFH2, 2^16-1)
   = FWRITE(lnFH1, lcBuffer)
ENDDO
* Close files
= FCLOSE(lnFH1)
= FCLOSE(lnFH2)
* Delete temp file
ERASE (lcTempFile)
>Hi, Sergey,
>Thank you. I want to print a report to a text file. I have two ways to do that:
>A. set printer to (filename) [addi]
> report form (report name) to printer
> set printer to
>B. report form (report name) to file (txt file name) ASCII
>
>I want to use the [addi] option in A, beacuse it will ADD ALL THE PRINT RESULT TO ONE TEXT FILE. In B,it doesn't have a [addi] option to do the same job. However, when I try to do use A, the report always be printed to printer instead to a text file (filename).
>Any idea?
>
>Thanks again.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform