Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Need some help on printing to multiple devices

edited December 2004 in General
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;

Comments

This discussion has been closed.