Notifications
Announcements
No record found.
I have class generated CSV file report. Need to send a mail with csv file attachment directly. With out saving through X++ code in F&O.
You mentioned a report and a file. I'll assume that you have a class creating CSV without using SSRS.
In that case, you can use something like this:
SysMailerMessageBuilder builder = new SysMailerMessageBuilder() .setFrom(...) .addTo(...) .setSubject(...) .setBody(...) .addAttachment(attachmentStream, 'file.csv'); SysMailerFactory::sendNonInteractive(builder.getMessage());
hear I am using SSRS
I still have no idea what you do in your class, but this is how you can print an SSRS report to a file and send it as an email attachment:
SrsReportRunController controller = ... // Change print settings as needed settings = controller.parmReportContract().parmPrintSettings(); settings.printMediumType(SRSPrintMediumType::File); settings.fileFormat(SRSReportFileFormat::CSV); settings.fileName('report.csv'); SrsReportEMailDataContract emailContract = new SrsReportEMailDataContract(); emailContract.parmTo(...); emailContract.parmSubject(...); emailContract.parmBody(...); settings.parmEMailContract(emailContract); // Execute the report controller.startOperation();
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 584 Most Valuable Professional
André Arnaud de Cal... 499 Super User 2025 Season 2
Sohaib Cheema 254 User Group Leader