So first I created a report from a button that you could run for one vendor, just to make sure it's working. I put dates as parameters so we could run some stuff from the past to see if it was working right. After working out all the bugs, the report works great. I'm using Docentric for the report which is like any other SSRS except is has a DSP class included with the DP, Controller and Contract classes. I'm also sending the report via email to whomever is marked as the contact in the vendor itself. Here is a screen shot of how I would run it manually for one vendor
So now I want to create a batch class that loops through the vendors and then sends that report. I can then setup that batch job to recur every 3 months. I'm getting an error when trying to run it and it's probably because I'm not sure how to set up the email settings. Can someone please help.
public void run() { VendTable vendTable; Args args; TCI_SupplierScoreCardController controller; TCI_SupplierScoreCardContract contract = new TCI_SupplierScoreCardContract(); while select vendTable where vendTable.TCI_SendSupplierScoreCard == NoYes::Yes { args = new Args(); args.record(vendTable); controller = new TCI_SupplierScoreCardController(); controller.parmReportName(ssrsReportStr(TCI_SupplierScoreCard, Report)); controller.parmArgs(args); //contract = controller.parmReportContract().parmRdlContract(); contract.parmRecId(vendTable.RecId); contract.parmEndDate(today()); DatePhysical newStartDate; newStartDate = prevMth(today()); newStartDate = prevMth(newStartDate); contract.parmStartDate(newStartDate); SRSPrintDestinationSettings pds = controller.parmReportContract().parmPrintSettings(); pds.printMediumType(SRSPrintMediumType::Email); controller.parmExecutionMode(SysOperationExecutionMode::Synchronous); controller.parmShowDialog(false); controller.startOperation(); } }