Printing Issue - Word / Crystal

K

Karthik

I've a strange problem, I've posted this to almost all the forums but I
didn't get the solution can any one pls look into this.

Here is my problem:

Well I am coding an application using C# for my company which requires
multiple printing of Crystal Report Docs & Word Docs, at a specific
Printer of the installed Printers in the network, at a specific tray and
some more settings too.

Since I'm trying with the network printer I've installed a local driver
using the local port as suggested by one of the MS support site.

The definition of the Printer & Tray is happening from the code (dynamically
based on the inputs given by the user thru some other screen ...say Maintain
Printer), and there should not be a user interface (A print preview or
printer settings box etc.)

Here go my attempts:

Since I need to have a common solution both for word and crystal printing
I've decided to do this thru WinAPIs. so I tried to set all
the settings thru WinAPIs (SetPrinter, DocumentProperties, ..) but ....

1. These settings are not reflected into the driver properties(I'm using the
standard code for setting the printer settings, and my
WinAPI calls are successfully executing)

2. Even if I change the settings directly thru driver properties (without
programmatically....just for testing) and tried giving printout using
wordObject.PrintOut() method but this wordObject is overriding the driver
settings.

So the problem here is I cannot have a common approach (the enum values)
both for word and crystal.


Since word and crystal object's Enums are different I need to have a common
solution for both word and crystal object.

WinAPIs may not be the only solution to my problem if you find anything
else that will solve my problem then I'll follow that.

I'm having one screen called "MaintainPrinter" which should
capture and store (to database) all the printer information like printer
name, Orientation, Papersource, Papersize..etc in my network. Here in what
format should I store this information...like for papersource "Tray 1", "Tray
2" ...Or its enumerations 1, 2, ....

And while applying to word or crystal how I do mapping between what I stored
and what it expects? This is my exact problem.

So to solve this problem I decided to go by WinAPI, since WinAPIs will act
as a common solution both for Word and Crystal. Is it right ?

By using WinAPIs I'll set the necessary printer settings and make the
descried printer as the default printer.

And Ultimately I give print thru word object's print method or crystal
object's print method.

So what I thought was all the settings made thru WINAPIs will be applicable
for my current print.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top