A strange and challenging problem: word / crystal / printing / C#
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 localdriver 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 otherscreen ...say Maintain Printer), and there should not be a user interface (A print preview or printer settings box etc.)
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 any one 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 informationlike printer name, Orientation, Papersource, Papersize..etc in my network. Here in what format should I store this information…like forpapersource "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 printthru word object's print method or crystal object's print method. So what I thought was all the settings made thru WINAPIs will beapplicable for my current print.

