Solved

Crystal Reports XI only prints to deafult printer

Posted on 2011-03-24
3
479 Views
Last Modified: 2012-05-11
Hi,
we've developed a J2EE app, which uses Crystal Reports Server XI (a.k.a. CRXI) to print documents that support operations.
We are using remote scheduling to accomplish that task.  We've been able to supply the printer name (for example, Printer1) into the request that we send to CRXI.  
Sometimes (very few, dont know why) CRXI prints to the supplied printer (Printer1).  
But now, it always does print to the default OS printer (DefaultPrinter).  
Looking in the RPT history, i can see that the print operation was successful, and that CRXI prints to Printer1.  But the job  is processed by, and paper sheets are thrown by, DefaultPrinter.
I want to know which are the possible causes for this behaviour.  We've not changed code that manages printing operation inside our app.
SO is Win 2003 Server R2 Standard Editon.
Thanks in advance for your comments.
Jaime
0
Comment
Question by:japintoce
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35215743
Is this a new application or was it running correctly and the behavior changed?

mlmcc
0
 

Accepted Solution

by:
japintoce earned 0 total points
ID: 35219971
Hi,
it's an old app and behavior changed. BUT:
We've found the solution.   It's a little complex to try to explain, but i'll try.
In order to create the CR object to schedule a report, we were using this query (as stated in some documentation, i think):
SELECT TOP 1 *
FROM CI_INFOOBJECTS
WHERE SI_PROGID = 'CrystalEnterprise.Report'
   AND SI_INSTANCE = 0
   AND SI_NAME = 'ReportName'
But this query (SELECT *) is very slow and inefficient, so after researching and googling we came to this:
SELECT TOP 1 SI_NAME,SI_OWNER, SI_FILES,
   SI_PROCESSINFO.SI_LOGON_INFO,
   SI_PROCESSINFO.SI_PROMPTS

FROM CI_INFOOBJECTS
WHERE SI_PROGID = 'CrystalEnterprise.Report'
   AND SI_INSTANCE = 0
   AND SI_NAME = 'ReportName'
We ommited the printer settings object in the above query; it's weird because i think the CR API should have complained about referencing an object that does not exists.  But instead, uses default printer !!!!!!
After a lot more of researching and googling, we found the missing object:    
                     SI_PROCESSINFO.SI_PRINTER_INFO
So the final functional query is:
SELECT TOP 1 SI_NAME,SI_OWNER, SI_FILES,
   SI_PROCESSINFO.SI_LOGON_INFO,
   SI_PROCESSINFO.SI_PROMPTS,
   SI_PROCESSINFO.SI_PRINTER_INFO
FROM CI_INFOOBJECTS
WHERE SI_PROGID = 'CrystalEnterprise.Report'
   AND SI_INSTANCE = 0
   AND SI_NAME = 'ReportName'

Hope this help.  Thanks for your comments.
0
 

Author Closing Comment

by:japintoce
ID: 35321811
It works; it's documented on CRXI docs.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now