Sunday, March 11, 2012

CR10 RDC Default Printer Issue

Hi All,

I'm glad to have found this forum! I've slogged thru Crystal issues on my own for quite a while now and it's a relief to have a place to go to share information. I have a few questions today, so please bare with me.

I'm converting an ASP application from CR8 to CR10 CE Embedded. For the most part I'm using RAS to display and print reports. I have a couple of reports where the users send the reports directly to the printer without viewing them first.

First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.

I'm experimenting with RDC in ASP and I'm having an issue with the default printer.

Second question, how do you set the printer using RDC? I'm using the following code:

Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")

Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")

session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false

The report keeps printing to the default printer, no matter what I'm setting it to programmatically. I thought maybe it had to do with the printer selected in the Report Designer, so I set that to "No Printer", and that didn't help.

I popped the oRpt object into the debug watch window and observed that the SelectPrinter method did not change the properties in oRpt. Hmmmm! Not sure what is going on there.

Third question, is there a good resource somewhere for learning the RDC and RAS object models? I can see the properties in a debug window, but I have not found good documentation on the methods. I have found that Business Objects has not improved the product documentation since they took over. It would really be nice to find a clear, concise reference of the object models.

Thanks!

LindaSecond question, how do you set the printer using RDC? I'm using the following code:

Set session ("oApp") = Server.CreateObject("CrystalRuntime.Application.10")

Set session("oRpt") = session("oApp").OpenReport(application("RASReportPath") + "XYTDailySchedule_test.rpt")

session("oRpt").SelectPrinter "winspool.drv", "DuplicationLaserJet", "P3_10.1.2.200"
session("oRpt").PrintOut false

I was able to figure this out on my own and am posting the solution in case somebody else is in the same boat. I had an error in the DeviceName and Port parameters. SelectPrinter must do validation before applying the parameters supplied. If the parameters are incorrect SelectPrinter does not change the printer settings. Perhaps there is a property in the RDC to trigger an error if this happens.........it certainly would have been useful to me!

I would still like to hear if anyone knows how to send a report directly to the printer using RAS, or if anyone has come across some good documentation of the RAS and RDC API's.

Thanks!

Linda|||First question, is there a way of sending a report directly to the printer and not the viewer in RAS? I haven't come across one and it looks like I'll have to use RDC for those reports.

VICTORY!!!! Just for the record, I was told months ago by Business Objects that this was impossible. I came across a white paper today, on the Business Objects site, that discusses RAS Server-Server Side printing, and gives you the code sample as well. Here it is:

http://www.buisnessobjects.com/global/pdf/dev_zone/ras_serverside_printing.pdf?ref=devzone_netzone_archive

Linda

No comments:

Post a Comment