Printing questions

  • Thread starter Thread starter Don Strenczewilk
  • Start date Start date
D

Don Strenczewilk

I'm working on a fairly simple app for our shipping department. Basically, a
Symbol bar code scanner communicates with a webservice, allowing the
operator to scan skids onto packing slips, and then print the packing slip.
The printing will be done on the webservice server using Crystal Reports.

The problems arise with printing by the webservice and Crystal has published
a solution to the problem which involves changing the machine.config file to
make the net framework run under the "SYSTEM" account rather than "machine",
and copying printer settings from the hkey_current_user hive to the .default
hive.

So, question 1 is: are there any security implications to consider when
changing the framework's to run under the SYSTEM account?

Question 2: The cleanest way I can think of to avoid these obscure
configuration changes is to export the report to a .pdf somewhere and and
have another program, which is running under a normal user account, monitor
that directory and print and delete the .pdf's when they appear. I'd rather
not constantly poll for changes and vaguely recall that there was a win32
api that dealt with this. Can anyone point me to some code or documentation
that would help?

Question 3: Anyone got any better ideas about how to deal with this?

Thanks!
 
I am not sure if this is a suitable solution for you... but here is how I
print a wide range of reports...

1. all my data is in a sqlce database on a device... ( i get the data from a
variety of sources, replication, Webservices, User generated)
2. I use Syware's reportce with sqlce enable to generate reports from my the
database
3. I click print... the nice thing about reportce... and the reason I got
the product, is that it has built in printing ability to a wide range of
printers.

In your scenario as described, this process would not be fast... ie taking
data placing it in sqlce and reporting from it...

This scenario may give you some food for thought... it really allows you to
easily generate any type of report quickly and print them easily which is
nice!

Regards,

éric
 
Thanks for the tips, Eric. I appreciate the food for thought.

After posting that message, I fired up VS and quickly noticed the
System.IO.FileSystemWatcher component sitting right there on the tool
palette (I'm getting old). I created a service that monitors a directory for
the creation of *.pdf files, and prints them using the Process and
ProcessStartInfo classes. That's as far as I got before I went home, so I'll
find out tomorrow if it actually works. I figure I'll set the service up to
run under a user account so the default printer can be easily added/changed
in case of a printer failure. I doubt I'd be able to guide the shipping guy
how to reconfigure the printer with reportce over the phone. The scanner
just passes a packing slip id (int) to a webservice which generates and
exports the pdf. That part is done, tested, and quite fast.

Thanks again,

Don S.
 
Don

I'm having similar problems with a app I'm developing. My additional problem is that I'm relatively new to VS.Net 2003! I'm wondering if you can share more about your code for listening for pdf's and automatically printing them. Also how has that worked out for you

Thanks
Brit
 
Sorry to be so late responding. I ended up giving up on pdf files because if
I print one, a copy of acrobat stays in memory. You can test this by simply
right clicking on a pdf file, select print, then look at task manager.
(this is with win2k).

What I endeded up doing was use the ComponentOne report, and have the web
service simply write xml data to a directory. A windows service running
under a 'normal' user account monitors the directory for new files
(WatcherChangeTypes.Created) and prints them.

It works fine on 2 out of 3 printer drivers I tried. One Canon printer
driver did not work for some unknown reason but an alternate driver did.


Brit said:
Don,

I'm having similar problems with a app I'm developing. My additional
problem is that I'm relatively new to VS.Net 2003! I'm wondering if you can
share more about your code for listening for pdf's and automatically
printing them. Also how has that worked out for you?
 
Back
Top