Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

How to print to text file.

How to print the report to text file using Coding, not using report writter
in visual foxpro.
Thanks
[113 byte] By [Sagar] at [2007-11-10 12:49:49]
# 1 Re: How to print to text file.
On 22 Jun 2003 21:03:33 -0700, "Sagar" <sagars_r@rediffmail.com>
wrote:

>
>How to print the report to text file using Coding, not using report writter
>in visual foxpro.
>
>Thanks

While you can do this using the @SAY command, it's not generally a
good idea. If your goal is to send all the data in a particular table
or cursor to a text file, take a look at the COPY TO command. If
that's not it, what are you trying to do?

Tamar
Tamar E. Granor at 2007-11-11 23:50:47 >
# 2 Re: How to print to text file.
Hello, Sagar!
You wrote on 22 Jun 2003 21:03:33 -0700:

S> How to print the report to text file using Coding, not using report
S> writter in visual foxpro.

To add to Tamar's suggestion: you can send the text file to the default TXT
file handler (by default it is notepad.exe):
DECLARE INTEGER ShellExecute ;
IN SHELL32.DLL ;
INTEGER nWinHandle,;
STRING cOperation,;
STRING cFileName,;
STRING cParameters,;
STRING cDirectory,;
INTEGER nShowWindow
?ShellExecute(0,"print","yourfile.txt","","",1)
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
Eric den Doop at 2007-11-11 23:51:53 >
# 3 Re: How to print to text file.
Tamar E. Granor <> wrote:
>On 22 Jun 2003 21:03:33 -0700, "Sagar" <sagars_r@rediffmail.com>
>wrote:
>
>>
>>How to print the report to text file using Coding, not using report writter
>>in visual foxpro.
>>
>>Thanks
>
>While you can do this using the @SAY command, it's not generally a
>good idea. If your goal is to send all the data in a particular table
>or cursor to a text file, take a look at the COPY TO command. If
>that's not it, what are you trying to do?
>
>Tamar

Thanks Mr. Tamar for your suggestion.

I want to know that whatever i am printing to console by code,should go to
text file rather. My Aim is print the report on printer and same should be
priviewed as report. i don't want to use report writter for that. i want
to do it by coding.

Thanks
Sagar
Sagar at 2007-11-11 23:52:51 >
# 4 Re: How to print to text file.
On 24 Jun 2003 21:14:21 -0700, "Sagar" <sagars_r@rediffmail.com> wrote:

>Thanks Mr. Tamar for your suggestion.

<pssst! Word to the wise: That's "Ms" Tamar :-) >

>I want to know that whatever i am printing to console by code,should go to
>text file rather. My Aim is print the report on printer and same should be
>priviewed as report. i don't want to use report writter for that. i want
>to do it by coding.

Respectfully, why don't you want to use the report writer? What will you gain
by not using the report writer? Especially since you want the preview function,
which is built into the report writer?

Ignore munged e-mail address above.
If necessary to reply via e-mail, please reply to:
caracal A T caracal D O T net
Vince Teachout at 2007-11-11 23:53:53 >
# 5 Re: How to print to text file.
On 24 Jun 2003 21:14:21 -0700, "Sagar" <sagars_r@rediffmail.com>
wrote:

>I want to know that whatever i am printing to console by code,should go to
>text file rather. My Aim is print the report on printer and same should be
>priviewed as report. i don't want to use report writter for that. i want
>to do it by coding.
>

You can check out the SET DEVICE and SET ALTERNATE commands. I haven't
used any of those in many years (because the Report Designer is much
easier than hand-coding), but something in there should help you.

Tamar
Tamar E. Granor at 2007-11-11 23:54:47 >