Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding to a Text File

Status
Not open for further replies.

Philka

IS-IT--Management
Jun 19, 2001
11
0
0
US
I am using the Report module to print to a file
REPORT FORMAT PK1500.FRX .... to file Output.
The report writer calls a Generic text only
printer.
I would like to be able to add further text
information to the file. Any thoughts or assistance
would be helpful.
Phil Kawesch
 
Hi Phil;

You can add a report title or summary page.
On the report form window select Report... Title/Summary...

Select either a title or summary and click New Page.
You can put whatever you want in this band.

You might want to add a second dbf to your report environment with 1 record containing a memo field.

Hope this helps.

Ed
 
Phil;

Another way would be to use the low level file functions.

To add to the end of the file:

lnhandle = fopen('filename.txt',2) && open read/write
=fseek(lnhandle,0,2) && move to end of file

Ed
 
Have you thought of printing each report to a database memo field and then using the
copy memo command or another report just to print the memo field
[tt]
set memowidth to 100
create table c:\temp\report (report m)
......
report form xxxx to file c:\temp\report.msg for condition1
do PopRpt
report form xxxx to file c:\temp\report.msg for condition2
do PopRpt
.......
select REPORT
if by_report_form

report form REPORT.MEMOFIELD to print

else

delete file c:\temp\report.msg
goto top
scan all
copy memo REPORT.REPORT to c:\temp\report.msg additive
endscan
type c:\temp\report.msg to print

endif
........


procedure poprpt
if not used("REPORT")
select 0
use C:\temp\report
endif
select REPORT
append blank
append memo REPORT.REPORT from c:\temp\report.msg overwrite
return
[/tt] David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
Ed-
I used your idea. Thanks.
I created a single record dbf with a memo field.
After creating the text file using the report writer,
I "append memo notes from". After each text file
is created, the memo field can then be appended.
At the point the user is finished adding text files
to the memo field, the memo field is copied to a
text file. It is now ready for electronic submission
as a bill to an online billing service.
Thanks for the rest of your interest and assistance.
Phil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top