Once I exported a file as an excel file. How do I capture the filename that is I have saved as. ie. documents was saved as c:\test.xls in the file save dialogue. I then can use this to attache to an email
Try checking the TppFileDevice.FileName property of the specific file device you are using in the AfterPrint Event.
(Instead of TppFileDevice, use your specific device type)
procedure TForm1.ppReport1AfterPrint(Sender: TObject); var liIndex: Integer; lDevice: TppFileDevice; begin
for liIndex := 0 to ppReport1.Publisher.DeviceCount - 1 do begin if ppReport1.Publisher.Devices[liIndex] is TppFileDevice then lDevice := TppFileDevice(ppReport1.Publisher.Devices[liIndex]); end;
Comments
Try checking the TppFileDevice.FileName property of the specific file device
you are using in the AfterPrint Event.
(Instead of TppFileDevice, use your specific device type)
procedure TForm1.ppReport1AfterPrint(Sender: TObject);
var
liIndex: Integer;
lDevice: TppFileDevice;
begin
for liIndex := 0 to ppReport1.Publisher.DeviceCount - 1 do
begin
if ppReport1.Publisher.Devices[liIndex] is TppFileDevice then
lDevice := TppFileDevice(ppReport1.Publisher.Devices[liIndex]);
end;
ShowMessage(lDevice.FileName);
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com