Using escape commands through RP
Does anyone have any experience using escape commands from within RB?
Specifically the problem I'm having is that I can't seem to inject commands
into the middle of the print stream. It's as if RB is eating them.
I'm basically using the TppReport.Printer.Canvas.Handle and the windows
escape function to send the commands. I'm fairly certain the commands
themselves are good because if I use the Printers.Printer.Canvas.Handle they
work fine except that they print as separate documents.
Report Builder 6.0.3 Professional
Preston
Specifically the problem I'm having is that I can't seem to inject commands
into the middle of the print stream. It's as if RB is eating them.
I'm basically using the TppReport.Printer.Canvas.Handle and the windows
escape function to send the commands. I'm fairly certain the commands
themselves are good because if I use the Printers.Printer.Canvas.Handle they
work fine except that they print as separate documents.
Report Builder 6.0.3 Professional
Preston
This discussion has been closed.
Comments
We do not have any examples, but it is definitely doable. I have
corresponded with customers who have implemented this.
ReportBuilder is not 'eating' any of your calls. ReportBuilder issues
commands to Begin/End the print job and Start/End each page. It has no
awareness of any calls that you make.
Perhaps its a timing of issue. Perhaps the printer only responds to calls
when they are made at specific times during the print process. I do not know
about escapes, but I know using windows DevMode to control the printer works
in this manner.
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
command. For example, should I put a variable on the report and then do the
escape in its OnPrint event?
it's always at the start of the print job. It doesn't matter where I do the
escape command it does not get put in the middle of the print job. I've
tried VarriableOnPrint, DetailBandAfterPrint, and FooterBandBeforePrint.
They all behave the same.
What event would I use to ensure that my escape command appears where I
expect it to in the RB print job.
When printing to the printer, Report.PrinterDevice will be non nil. You
might trying using its OnStartPage or OnEndPage events. You have to assign
these in the Report.BeforePrint event.
In the Report.BeforePrint event....
if (myReport.PrinterDevice <> nil) then
myReport.PrinterDevice.OnStartPage := myPrinterDevice_StartPageHandler;
See RBuilder\Source\ppPrnDev.pas
--
Nard Moseley
Digital Metaphors Corporation
http://www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Assuming that this works. This will basically limit me to these particular
events correct? There isn't anyway to drop a variable on the report and get
the escape command to occur at that point?
Also, I've sent the hex dump to the printer manufacturer and they've
confirmed that the escape code is being pushed to the front of the print job
by the software creating the print job (which would be RB).
You mentioned you have some clients that are successfully doing this. Would
you mind asking them how they're doing it?
Preston
Here what I think (my opinion) was going on. I was using the Raster driver
which converts everything to a bmp. Windows was seeing my escape command and
was moving in front of the raster block because how do you convert a escape
command to a BMP and still have it work.
I've since installed a LineMode driver which allows me to use the control
font. I've got a problem with that but will start a separate thread.
Thanks for the help.
a trying to do the same thing here.
regards,
Carlos MacLeod
Here is a downloadable example.
www.digital-metaphors.com/tips/PrinterEscapeCommands.zip
(Thanks to Sher Hurlburt who sent an example to me yesterday, which I used
to create this downloadable example.)
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com