Printing in DataPortal

Printing in DataPortal

Old forum URL: forums.lhotka.net/forums/t/4539.aspx


Ramp posted on Sunday, March 23, 2008

How do we do auto printing  in the DataPortal_Fetch method? I tried using System.Diagnostics.Print

but the application hangs when running on remote server?

tmg4340 replied on Sunday, March 23, 2008

Well... does your remote server have any printers set up?  Does it have a default printer?  With a remote server, the DP_ code in your object isn't running on the client workstation, so in order to print from those routines, you'd need to have a printer set up on your remote server.

I'm also kinda wondering why you want to print anything from there...

- Scott

Ramp replied on Monday, March 24, 2008

Thank you for the reply,. but my remote server has the printer setup and the default printer also set. I need to print on the server as My client would be at various location and they generate letters and need to auto print. but the print job has to be at a centralized location so felt that we need to do it in the remote server as that takes care of this scenario

- Ramp

RockfordLhotka replied on Monday, March 24, 2008

I don't know the answer, but a couple things come to mind.

First, make sure the user account under which your server code is running has access to the printer. I don't think the default IIS user can get to the printer?

Second, you may need to figure out a way to defeat any dialogs that would pop up. Obviously on the server no dialog can pop up, but perhaps this is blocking the thread, because the print API you are using is waiting for user input?

Copyright (c) Marimer LLC