Job Traveller Print in a Customization

Hi! I’m trying to print a job traveller report in customization code, and it works great with this code

////////////////////

Ice.Core.Session otSession = (Ice.Core.Session)this.oTrans.Session;
String strWorkstationID = Ice.Lib.Report.EpiReportFunctions.GetWorkStationID(otSession);

Erp.Proxy.Rpt.JobTravImpl report = WCFServiceSupport.CreateImpl<Erp.Proxy.Rpt.JobTravImpl>(otSession, Epicor.ServiceModel.Channels.ImplBase<Erp.Contracts.JobTravSvcContract>.UriPath);
Erp.Rpt.JobTravDataSet ds = report.GetNewParameters();

ds.JobTravParam[0].Jobs = strJobNum;
ds.JobTravParam[0].AutoAction = “SSRSClientPrint”;
ds.JobTravParam[0].AgentSchedNum = 0;
ds.JobTravParam[0].AgentID = “SystemAgent”;
ds.JobTravParam[0].AgentTaskNum = 0;
ds.JobTravParam[0].ArchiveCode = 0;
ds.JobTravParam[0].ReportStyleNum = 1003;
ds.JobTravParam[0].WorkstationID = strWorkstationID;
ds.JobTravParam[0].DateFormat = “dd/mm/yyyy”;
ds.JobTravParam[0].NumericFormat = “,.”;
ds.JobTravParam[0].PrntAllMassPrnt = true;
ds.JobTravParam[0].PrinterName = printerName;
ds.JobTravParam[0].SSRSRenderFormat = “PDF”;

ds.JobTravParam[0].RptPageSettings = “Color=False,Landscape=True,PaperSize=[Kind=“Letter” PaperName=“Letter” Height=1100 Width=850],PaperSource=[SourceName=“Automatically Select” Kind=“FormSource”],PrinterResolution=[Kind=“Custom” X=600 Y=600]”;
ds.JobTravParam[0].RptPrinterSettings = “PrinterName=” + dquote + printerName + dquote + “,Copies=1,Collate=True,Duplex=Simplex,FromPage=1,ToPage=0”;

//////////////////

And this prints great, however, rather than hardcoding the report style, and RptPageSettings, and RptPrinterSettings, I’d prefer to get them from the defaults shown on these screens


image

Where is this information stored and is there a easy way to get to it?

-Scott

If you run a trace, you will see there are a few more methods being called (Like Workstation, etc). This will show where the defaults are coming from.

I’ll check it again, I already traced it to see what it was running, which was how I figured out how to print. But I didn’t see the printer defaults (other than what was filled in the parameters sent to the “Submit”)

Thanks!

-Scott

I’ve done some more tracing but still stumped, the method to submit the report traces like this


Erp.Proxy.Rpt.JobTravImpl SubmitToAgent net.tcp://dev-cm-app1/EpicorERP/ System.Void 12/9/2019 09:56:12:2869652 AM 1 0 false 100273-5-1 false false false false true false false false false 00000000-0000-0000-0000-000000000000 SSRSClientPrint \\DSV-Print\DSV-Bristol IST 0 SystemAgent 0 false Color=False,Landscape=True,PaperSize=[Kind="Letter" PaperName="Letter" Height=1100 Width=850],PaperSource=[SourceName="Automatically Select" Kind="FormSource"],PrinterResolution=[Kind="Custom" X=600 Y=600] PrinterName="\\DSV-Print\DSV-Bristol IST",Copies=1,Collate=True,Duplex=Simplex,FromPage=1,ToPage=0

But I don’t see how the “JobTravParam” parameters are filled from those 2 screens I posted earlier. Yes, I can manually create a parameters dataset with .GetNewParameters, and manually assign it all, but I’m trying to figure out how to use the defaults, or even if I can. But I don’t see in the trace any reference to JobTravParams until the Submit. Am I missing something I need to turn on in the trace?

SubmitToAgent takes 5 params which are JobTravParam, the name of the Agent, the agent schedule and agent task num, and then “Epicor.Mfg.UIRpt.JobTrav”). Maybe it’s getting the defaults from the passed in Epicor.Mfg.UIRpt.JobTrav?

-Scott

The parameters are gathered when the form opens. There should be a number of calls before this one.

Maybe this?

Ice.Proxy.BO.GenXDataImpl
GetList
Ice.Tablesets.XXXDefListTableset