All, I’m hoping (anyway) that someone has encountered the following and has found a way through it.
We’re in a cloud environment and use the Edge Agent to accommodate SSRS printing to local networked printers - as I imagine most cloud folks do.
Using the great examples that have existed on this site, I’ve created lots of button-launched reports, but this is the first time attempting it in a cloud environment, and I’m having quite the time trying to get it to work.
So, I have a customized Job Traveler at Style 1003, and I’ve successfully packaged the service code necessary to launch the report into a Function. For testing, I use the 'AutoAction = SSRSPreview" setting and it works perfectly.
However, changing that to SSRSPrint (and supplying the Edge Agent printer name) generates an error in the System Monitor. I’m certain that I am missing some needed parameters, but I have no idea which.
Can you spot the error or missing param(s)?
using (var svcJobTrav = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobTravSvcContract>(context))
{
Erp.Tablesets.JobTravTableset tsJobTrav = svcJobTrav.GetNewParameters();
string strWkst = "PRT57";
string prnName = @"Prt57@SRV-ISTEST2-EdgeAgent";
if (tsJobTrav != null)
{
tsJobTrav.JobTravParam[0].Jobs = "001237-1-1";
//tsJobTrav.JobTravParam[0].PrntAllMassPrnt = false;
tsJobTrav.JobTravParam[0].PrinterName = prnName;
tsJobTrav.JobTravParam[0].BarCodes = true;
tsJobTrav.JobTravParam[0].AutoAction = "SSRSPRINT";
tsJobTrav.JobTravParam[0].AgentID = "SystemAgent";
tsJobTrav.JobTravParam[0].ReportStyleNum = 1003;
tsJobTrav.JobTravParam[0].WorkstationID = strWkst;
tsJobTrav.JobTravParam[0].SSRSRenderFormat = "PDF";
tsJobTrav.JobTravParam[0].RowMod = "A";
svcJobTrav.SubmitToAgent(tsJobTrav, "SystemTaskAgent", 0, 0, "Erp.UIRpt.JobTrav");
}
}
Errors…
System.NullReferenceException: Object reference not set to an instance of an object.
at Ice.Lib.MessageHub.EdgeMessageHubSender.Print(Byte[] reportBytes, String printerName, String reportDescription, EpiPrinterSettings printerSettings, EpiPageSettings pageSettings) in C:\_releases\ICE\ICE4.2.300.0\Source\Server\Internal\Lib\Ice.Lib.MessageHub\EdgeMessageHubSender.cs:line 57
at Ice.Core.SsrsReporting.PdfReportPrinter.Print(Byte[] reportBytes, String printerNameParameter, String reportDescription, EpiPrinterSettings printerSettings, EpiPageSettings pageSettings, Int64 sysTaskNum, Func`2 getSysRptLstRowSysRowID) in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\SsrsReporting\PdfReportPrinter.cs:line 69
at Ice.Core.SsrsReporting.ReportProcessorBase.RenderReportForPrintOrEmailReport(RenderedSsrsReport renderedReport, Boolean serverSidePrint, Boolean ignorePageSettings) in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\SsrsReporting\ReportProcessorBase.cs:line 573
at Ice.Core.SsrsReporting.ReportProcessorBase.ProcessReportPart(String reportLocation) in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\SsrsReporting\ReportProcessorBase.cs:line 168
at Ice.Core.SsrsReporting.StandardReportProcessor.ProcessReportParts() in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\SsrsReporting\StandardReportProcessor.cs:line 34
at Ice.Core.RoutingAndBreaking.ReportPersister.Persist(ReportInstanceInformation reportInstance, Func`2 reportsRenderer, Action`1 fillSysRptLstRow, Action`2 processReport, Func`3 filterTableAttachmentsFunc) in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\ReportPersister.cs:line 58
at Ice.Core.RptBase.ReportSsrsDatabaseBuilder.RenderUnroutedSsrsReport() in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\RptBase\ReportSsrsDatabaseBuilder.cs:line 359
at Ice.Core.RptBase.ReportDatabaseBuilder.XMLClose() in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDatabaseBuilder.cs:line 93
at Ice.Core.RptTaskBase`1.XMLClose() in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Internal\Lib\TaskLib\RptBase\RptTaskBase.cs:line 260
at Erp.Internal.JC.JobTrav.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:\_releases\ERP\ERP11.2.300.0\Source\Server\Internal\JC\JobTrav\JobTrav.cs:line 579
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 68
at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_releases\ICE\ICE4.2.300.10\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 64
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_releases\ICE\ICE4.2.300.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_releases\ICE\ICE4.2.300.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 450