Auto e-mail, save as file tasks in reports
There are some reports that demand no user interaction and are expected to be directly saved in a file or e-mailed. This recipe will share how the printer settings contract can be used to achieve this in a simple manner.
How to do it…
This recipe has been divided into two sections. The first section details how to save the report to a file, and the second section details how to send it through e-mail.
Saving the report to a file
To save a file onto the printer, create a new static method in the controller class or in the class from where the report is invoked.
In the method, place the following code to save the report:
public static void saveReporttoFile(Args _args) { /*if the controller is not overriden for your report then use appropriate controller*/ SrsReportRunController controller = new PktRdlCustTransListController(); SRSPrintDestinationSettings printSettings; controller.parmReportName(ssrsReportStr(PktRdlCustTransList, CustTransList...