Hi,
I have a requirement to save my PO confirmation report as PDF format file name should be "PurchId-Supplier Account-supplier email address-PurchaseOrder.pdf"(00001-000) in custom destination folder file path by using print management setup. When I open the report the report should be saved automatically in PDF with custom file format. The file path should consider from print management setup.
Please help me out from this..!!!
Thanks,
Suresh M.
*This post is locked for comments
You may use this blog as a solution , you just need to change the Document type enum.
https://shayanarshi.blogspot.com/2020/01/retrieving-report-name-set-in-print.html
Hi try code below . I am using it for sending email with my own file. You can use it and save your file on ur destination
SrsReportRunController controller = new SrsReportRunController();
HRMParameters parameter = HRMParameters::find();
SRSPrintDestinationSettings settings;
FilePath outputFilePath;
Str1260 subject,body;
;
subject = "active employee report";
body = "your hTML body"
// Define report and report design to use
controller.parmReportName(ssrsReportStr(ReconReport, PrecisionDesign1));
// Use execution mode appropriate to your situation
//controller.parmExecutionMode(SysOperationExecutionMode::ScheduledBatch);
// Suppress report dialog
controller.parmShowDialog(false);
controller.parmLoadFromSysLastValue(false);
// SrsReportDataContract srsReportDataContract = controller.parmReportContract();
//srsReportDataContract.parmisMemoryStreamOnly(true);
//controller.parmReportContract(srsReportDataContract);
// Change print settings as needed
settings = controller.parmReportContract().parmPrintSettings();
// set the print destination in contract
settings.overridePrintContractSettings(true);
settings.printMediumType(SRSPrintMediumType::Email);
settings.emailAttachmentFileFormat(SRSReportFileFormat::Excel);
settings.emailTo(email@gmail.com);
settings.emailSubject(subject);
settings.fileName('ReconData');
settings.parmEMailContract().parmBody(body);
//settings.overwriteFile(true);
controller.parmReportContract().parmPrintSettings(settings);
// Execute the report
controller.startOperation();
Hi ,
Thanks for your quick response.!!!
I want to override default standard print settings where I need to pass my custom file name "PurchId-Supplier Account-supplier email address-PurchaseOrder.pdf" in srsprintmanagementsetting classes for PO confirmation report. If you have sample code snippet please post here.
Thanks in advance.!
Hey,
You should add your code in place where users are opening purch confirmation. To generate PDF report, you can use EPSendDocument class, which can generate and save your purch confirmation as PDF file in given destination with your file name.
Please let us know if you need more help.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156