[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Printing problem - the job disapears from the spooler

Posted on 2003-11-01
3
Medium Priority
?
535 Views
Last Modified: 2012-08-14
Environment:
  OS: Windows XP
  Programming language: Delphi 4 + service packs
  VCL component version: 7.4.0.41, VCL for Delphi 4
  Crystal Reports: Development Edition 8.5.0.217

Specification:
The program has to print a crystal report without user intervention to a nominated printer in the program's options. This is part of a automated process and it should just print the report and move on.
I have currently installed 3local printers: Genreric Text ,Panasonic KX-P6100 , dummy printer that prints to a file

Depending on wich is my default printer and which printer is set up in the program's option I get the strage situation when the report is sent to the spooler, it sits there for a half of second saying "Spooling" and that it disapears. There are no errros and no messages. This happens when I tell the report on which printer to print.
If I bring up the printer selection dialog and select the printer than it work juts fine.

Here is the calling code for the crystal report that I am using:

Oderreport: TCrpe; - this is the static Crystal Report component on the form
*****************
      OrdersReport.Clear;
      OrdersReport.ReportName :=  'name of the report file.rpt' ;
      //Set database location
      OrdersReport.Tables.Retrieve;
      OrdersReport.Tables[0].Path := SysControl.DataDirectory;
      OrdersReport.Tables.Propagate := True;
      OrdersReport.output := toPrinter;

      OrdersReport.Printer.Name := SysControl.PrinterName;
      OrdersReport.Printer.ShowDialog := False;
      OrdersReport.Execute;
*************************

SysControl.PrinterName is pick-up up from the options of the program and it's the name of a windows printer as in Printer.Printers[2] wich returns the third printer in the windows printer list.


If I change in the code above only
   OrdersReport.Printer.ShowDialog := True;
and I hit the OK button on the Printer Dialog that appears it will print the report without problems.

Does anyone ever had or encoutered this problem ?

Thank you for your help.
0
Comment
Question by:Tavirgil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 300 total points
ID: 9665771
This link shows how it can be done in VB.  A similar approach should work from Delphi

http://www.experts-exchange.com/Databases/Crystal_Reports/Q_20762547.html

mlmcc
0
 

Author Comment

by:Tavirgil
ID: 9792193
I followed up on your advice to read from your post in VB and I've made sure that the report gets all the values needed for the printer (name, driver, port, handle).

This should be the case since in Crystal 8.5 it's adversited that you only need to put the name of the printer and crystal takes care of the rest.

Anyway I used some Windows API functions together with some Delphi functions to get these values rigth.

If anyone interested please tell me.

Thank's for the advice mlmcc and I'll accept your advice since I need it for a VB project that does the same thing as this one: sends the report to the spooler and the job just disapears. I believe I'll take the same aproach but just your code from the answer you pointed me too.

Cheers and thanks a lot.

Virgil
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 9792656
Glad I could help.

mlmcc
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

650 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