Need some help on printing to multiple devices
Hi,
For testing purposes i'm trying to print a report to a screen, printer and
archive device. I'm not sure if i'm doing things the right way.
- Report only prints to the screen (Designtime reports DeviceType) when
printing to multiple devices.
- How do i show printdialog when for a TppPrinterDevice when printing to
multiple devices.
- Is it possible to sent each page to a different file for a
TppArchiveDevice when printing to multiple devices.
Greetings,
Filip Moons
procedure TForm2.Button3Click(Sender: TObject);
var
Indx: Integer;
APrintDevice: TppPrinterDevice;
AScreenDevice: TppScreenDevice;
AnArchiveDevice : TppArchiveDevice;
APrintDeviceList: TList;
begin
APrintDeviceList := TList.Create;
try
// Printer
ppReport1.ShowPrintDialog := True;
ppReport1.DeviceType := dtPrinter;
APrintDevice := TppPrinterDevice.Create(Nil);
APrintDevice.Publisher := ppReport1.Publisher;
APrintDeviceList.Add(APrintDevice);
// Screen
ppReport1.ShowPrintDialog := False;
ppReport1.DeviceType := dtScreen;
AScreenDevice := TppScreenDevice.Create(Nil);
AScreenDevice.Publisher := ppReport1.Publisher;
APrintDeviceList.Add(AScreenDevice);
// Archive
ppReport1.ShowPrintDialog := False;
ppReport1.DeviceType := dtArchive;
AnArchiveDevice := TppArchiveDevice.Create(Nil);
AnArchiveDevice.Publisher := ppReport1.Publisher;
AnArchiveDevice.PageSetting := psAll;
AnArchiveDevice.FileName := 'Report123.RAF';
APrintDeviceList.Add(AnArchiveDevice);
ppReport1.PrintToDevices;
finally
for Indx := Pred(APrintDeviceList.Count) downto 0 do
TObject(APrintDeviceList[Indx]).Free;
APrintDeviceList.Clear;
FreeAndNil(APrintDeviceList);
end;
end;
For testing purposes i'm trying to print a report to a screen, printer and
archive device. I'm not sure if i'm doing things the right way.
- Report only prints to the screen (Designtime reports DeviceType) when
printing to multiple devices.
- How do i show printdialog when for a TppPrinterDevice when printing to
multiple devices.
- Is it possible to sent each page to a different file for a
TppArchiveDevice when printing to multiple devices.
Greetings,
Filip Moons
procedure TForm2.Button3Click(Sender: TObject);
var
Indx: Integer;
APrintDevice: TppPrinterDevice;
AScreenDevice: TppScreenDevice;
AnArchiveDevice : TppArchiveDevice;
APrintDeviceList: TList;
begin
APrintDeviceList := TList.Create;
try
// Printer
ppReport1.ShowPrintDialog := True;
ppReport1.DeviceType := dtPrinter;
APrintDevice := TppPrinterDevice.Create(Nil);
APrintDevice.Publisher := ppReport1.Publisher;
APrintDeviceList.Add(APrintDevice);
// Screen
ppReport1.ShowPrintDialog := False;
ppReport1.DeviceType := dtScreen;
AScreenDevice := TppScreenDevice.Create(Nil);
AScreenDevice.Publisher := ppReport1.Publisher;
APrintDeviceList.Add(AScreenDevice);
// Archive
ppReport1.ShowPrintDialog := False;
ppReport1.DeviceType := dtArchive;
AnArchiveDevice := TppArchiveDevice.Create(Nil);
AnArchiveDevice.Publisher := ppReport1.Publisher;
AnArchiveDevice.PageSetting := psAll;
AnArchiveDevice.FileName := 'Report123.RAF';
APrintDeviceList.Add(AnArchiveDevice);
ppReport1.PrintToDevices;
finally
for Indx := Pred(APrintDeviceList.Count) downto 0 do
TObject(APrintDeviceList[Indx]).Free;
APrintDeviceList.Clear;
FreeAndNil(APrintDeviceList);
end;
end;
This discussion has been closed.
Comments
Here are a couple examples that may help you with this...
http://www.digital-metaphors.com/tips/PrintToPrinterAndArchive.zip
http://www.digital-metaphors.com/tips/PrintToScreenAndArchive.zip
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thx for the examples but its still unclear how i can assign, when sending to
print/screen device and archive, each (print/screen) page from the report to
a different archive filename.
Greetings,
Filip
You will need to use the StartJob and EndJob events of the TppDevice in
order to print each page individually. See Demo 123 for an example of using
these events.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com