printing a report from within a service application

Hello,

Before turning to rave reports I tried using TPrinter, but this doesn't seem to work because the service has no Tform ?

Then I tried the rave thingies and managed to save some pdf files and also the preview is working, but when I try to print on paper (by setting the DefaultDest property from TRvSystem to rdPrinter) it doesn't work anymore. In fact it seems the app is hanging after that.

I got no problems in a normal application (containing a form).

Now I wonder if it's possible for a service (application) to print some report.

My service app is written in D7.

Can anyone help me to get a printout on paper from within a service ?

thanks in advance,
mdiwo
 
LVL 2
mdiwoAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
moduloConnect With a Mentor Commented:
PAQ'd and points refunded

modulo

Community Support Moderator
Experts Exchange
0
 
mdiwoAuthor Commented:
Hello again,
Recently I quit working with rave on my problem and began playing on TPrinter again. What I found out is that whenever I access the Printer.Printerindex or similar as for example in the line below, the program stops.

{Original TPrinter code}
procedure TPrinter.SetState(Value: TPrinterState);
...
   with TPrinterDevice(Printers.Objects[PrinterIndex]) do

Is there an expert that could tell me reason for this behaviour ?
An example how the printout would work would be even better...

thanks in advance


0
 
mdiwoAuthor Commented:
my problem seems to be solved as I found the tzprinter-object from logicomm that seems to work as intended.

imho there is a problem with delphi's own tprinter-object when a service application tries to access some of the printer-properties/methods like on printerindex.
0
All Courses

From novice to tech pro — start learning today.