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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report to file... and after to printer. 1

Status
Not open for further replies.

Fabmoda

Programmer
Jun 13, 2002
14
IT
A simple question for you form a beginner...

I send the output of a report to a file in this manner

****************************
select * from dbtest into curso cur_dbtest
select cur_dbtest
report form dbtest to file test.rep

****************************

Now I've produced this file TEST.REP; how can I print it by using a printer?

bye
fabiano
 
fabiano

Code:
DECLARE INTEGER ShellExecute IN "Shell32.dll" ;
    INTEGER hwnd, ;
    STRING lpVerb, ;
    STRING lpFile, ;
    STRING lpParameters, ;
    STRING lpDirectory, ;
    LONG nShowCmd
=Shellexecute(0,"Print","c:\TEST.REP","","",0)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Sorry Mike,
I've try to run it but i've obtained nothing from my printer! Something about enviroment settings that I probably forgot to verify?

tnx

fabiano


 
Fabiano,
I believe Mike's code assumes that the .REP extention is associated with a specific application. If it's NotePad, for example, then NotePad would fire up and print it. Since .REP isn't a standard extension, why not change it to .TXT, then all should work without other changes.

Note: Without the additional option of ASCII in your REPORT command, that file is going to have a lot of control characters that will be dependent on the current printer's Windows printer driver. NotePad, or any other application isn't going to intrpret these as expected!

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top