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

Print to File in W2K

Status
Not open for further replies.

dallas4u

MIS
Dec 29, 1999
23
0
0
US
I have a machine running software that automatically prints a report twice a day. I'd like to keep it "printing" the reports, but I want to see if it can print to a file without user intervention. Currently, when set to print to the Generic/Text printer, it will print to a file but only after it pops up asking where to print to.

Is there a way to set it to print to a specific file without needing any manual intervention? If it could actually print to an Excel file (being that the reports are in Excel format), that would just be icing on the cake!!

(Thanks in advance!)
 
Yes - create a new port called C:\Filename.txt and assign the Generic/text only driver to print to this. The output will go to the specified filename.

John
 
Thanks... this seems to work. My next question...

Is there a way to print to an Excel spreadsheet and keep the same format in Excel? The file being printed is in Excel format, and (of course) the format looks terrible in a regular .txt file. Is there any way to have it print to an Excel .xls file and keep the format? I have run a couple tests, and just having it print to c:\test.xls DOES put the data into a spreadsheet, but the format is off.

Does anyone know if this is possible?
 
A couple of questions:

1) Do you want to be able to load it back into excel afterwards?

2) Do you want to be able to print the formatted output file on a printer?

The answers to these (yes/no will suffice) will dictate my response.

John
 
1) Yes... and no. If there is a way to, then yes. If not, then no.

2) Yes, but again... if it can be read in Excel and not printed, then I would consider this option.

Adam
 
Adam

If you have an excel spreadsheet, and want to print it to a format suitable for reading into excel, why not just duplicate the .XLS file?

If you don't want to be able to edit the data, but print it elsewhere, then you could try printing to a .PDF file.

You could try printing to file using the ordinary printer driver, but this will produce a binary file on disk which can only be printed by doing a

copy /b filename > lpt1

from the command prompt to force it to print. It will only work on printers that support the page description language that the one you outputted to supports. It will certainly not be editable.

John
 
Well, here's how they have this situation set up...

The application was set to take a report and save it to a spreadsheet at 3am and 3pm everyday. Then, they wanted to print them at these times. We changed the application so it would bring up Excel in the background, print, and close. It does this on 4 machines, including the development machine for this application in my office. They do not need to have the reports print off of the machine in my office, but they still want the data collected, so I turned the printer off until I could find a simple solution to this.

I guess since it is still going to a spreadsheet, opening Excel, printing, then closing, we could just change it to where it would just go to the file, save, and not print. However, the reports are not being saved when they are printed... just printed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top