Is it Possible to set the attachment filename when printing a report to email? I can set the filename with the following code in report's fetch() method:
element.printJobSettings().filename(Zefilename);
The filename is visible in the SysPrintForm's file tab, but the filename is not set when using attachment file to email. The filename is set in the ReportSendMail() method in info class taking PrintJobSettings class as parm:
void reportSendMail(PrintJobSettings p1)
SysINetMail m = new SysINetMail();
str fileName = 'axaptareport';
;
/..../
m.sendMailAttach(p1.mailTo(),p1.mailCc(), p1.mailSubject(),'axapta report', true, p1.fileName(), fileName);
p1.filename() gives me the generated file 's path with a temp file name : "C:\user.....\AX6545Tmp.pdf" (6545 is a random number)
It seems that the printJobSettings class used in my report is not the one used there so how can I set attachment filename by customizing existing printing framework?
thanks for help
As you have observed the attachment file name for reports is static.
You will have customize the reportSendMail
method by using information from p1
only.