Andrew
(Andrew Saldivar)
January 7, 2022, 7:55pm
1
Hello All,
I am trying to get a BAQ report (SSRS), which is being launched via ButtonClick event, to run its breaking/routing rules.
When the report is launched normally (from BAQ Report Designer), the system tells me there are routing rules and asks if I want to run them.
Thanks to others’ posts, 've been able to successfully launch a preview of my BAQ report via the ButtonClick event, however, the associated breaking/routing rules do not run.
If anyone has a suggestion, I’d love to hear it. My guess is that a ‘flag’ in the report parameters must be set. Here is that section as it currently appears (and taken from other posts):
baqRptDS.BAQReportParam[0].AutoAction="SSRSPreview";
baqRptDS.BAQReportParam[0].PrinterName=@"\\Server01\HP LaserJet 400 MFP M425dn";
baqRptDS.BAQReportParam[0].RptPageSettings = "Color=False,Landscape=True,Margins=[Left=0 Right=0 Top=0 Bottom=0],PaperSize=[Kind='Letter' PaperName='Letter' Height=1100 Width=850],PaperSource=[SourceName='Auto Select' Kind='AutomaticFeed'],PrinterResolution=[Kind='Custom' X=600 Y=600]";
baqRptDS.BAQReportParam[0].RptPrinterSettings = @"PrinterName='\\Server01\HP LaserJet 400 MFP M425dn',Copies=1,Collate=False,Duplex=Simplex,FromPage=1,ToPage=1";
baqRptDS.BAQReportParam[0].PrintReportParameters=false;
baqRptDS.BAQReportParam[0].WorkstationID=workStation;
baqRptDS.BAQReportParam[0].SSRSRenderFormat = "PDF";
baqRptDS.BAQReportParam[0].Character01="PrintPrev";
baqRptDS.BAQReportParam[0].BAQRptID=("SRS-Report1");
baqRptDS.BAQReportParam[0].ReportID=("SRS-Report1");
baqRptDS.BAQReportParam[0].Summary = false;
baqRptDS.BAQReportParam[0].ReportStyleNum = 1;
baqRptDS.BAQReportParam[0].BAQID=("SRS-ReportSource");
baqRptDS.BAQReportParam[0].ReportTitle = "Report";
rptDs.AcceptChanges();
StringWriter writer = new StringWriter();
rptDs.WriteXml(writer);
baqRptDS.BAQReportParam[0].Filter1 = writer.ToString();
baqR.SubmitToAgent(baqRptDS, agentID, 0, 0, "Epicor.Mfg.UIRpt.BAQReport");
Any thoughts on what might be required?
1 Like
utaylor
(Utah Taylor)
January 7, 2022, 8:53pm
2
I believe your guess is correct.
Do a trace while you launch the BAQ report from the BAQ report designer test and look for SSRS Routing Enabled = true flag in the trace.
1 Like
jkane
(John Kane)
January 7, 2022, 9:04pm
3
Here is working code that does what you want. This prints out our Job Traveler and uses the routing.
{
// ** Place Event Handling Code Here **
EpiDataView edvMI = (EpiDataView)(this.oTrans.EpiDataViews["Job"]);
string jobNum = edvMI.dataView[edvMI.Row]["JobNum"].ToString();
int styleNum = 1007;
string pageSet = "Color=False,Landscape=False,PaperSize=[Kind=" +
"\"Letter\" PaperName=\"Letter\" Height=1100 Width=850],PaperSource=[SourceName=" +
"\"FormSource\" Kind=\"FormSource\"],PrinterResolution=[Kind=\"Custom\" X=600 Y=600]";
string printSet = @"PrinterName=""\\Epic01\BrotherDCPL2550DW"",Copies=1,Collate=True,Duplex=Simplex,FromPage=1,ToPage=0";
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].PrntAllMassPrnt = false;
ds.JobTravParam[0].Jobs = jobNum;
ds.JobTravParam[0].Assembly = null;
ds.JobTravParam[0].SubAssem = true;
ds.JobTravParam[0].NewPgPerAsm = false;
ds.JobTravParam[0].OprDates = false;
ds.JobTravParam[0].OprStd = false;
ds.JobTravParam[0].BarCodes = true;
ds.JobTravParam[0].ShpSchd = false;
ds.JobTravParam[0].PrintSchedResources =false;
ds.JobTravParam[0].PrintSchedResrcDesc = false;
ds.JobTravParam[0].OpInstructions = false;
ds.JobTravParam[0].AutoAction = "SSRSPreview";
ds.JobTravParam[0].PrinterName = "\\\\Epic01\\BrotherDCPL2550DW";
ds.JobTravParam[0].AgentSchedNum = 0;
ds.JobTravParam[0].AgentID = "SystemTaskAgent";
ds.JobTravParam[0].AgentTaskNum = 0;
ds.JobTravParam[0].RecurringTask = false;
ds.JobTravParam[0].RptPageSettings = pageSet;
ds.JobTravParam[0].RptPrinterSettings = printSet;
ds.JobTravParam[0].RptVersion = "";
ds.JobTravParam[0].ReportStyleNum = styleNum;
ds.JobTravParam[0].WorkstationID = strWorkstationID;
ds.JobTravParam[0].TaskNote = "";
ds.JobTravParam[0].ArchiveCode = 0;
ds.JobTravParam[0].DateFormat = "mm/dd/yyyy";
ds.JobTravParam[0].NumericFormat = ",.";
ds.JobTravParam[0].AgentCompareString = "";
ds.JobTravParam[0].ProcessID = "";
ds.JobTravParam[0].ProcessTaskNum = 0;
ds.JobTravParam[0].DecimalsPrice = 0;
ds.JobTravParam[0].GlbDecimalsGeneral = 0;
ds.JobTravParam[0].GlbDecimalsCost = 0;
ds.JobTravParam[0].GlbDecimalsPrice = 0;
ds.JobTravParam[0].SSRSRenderFormat = "PDF";
report.RunDirect(ds);
}
4 Likes
Andrew
(Andrew Saldivar)
January 7, 2022, 10:09pm
4
I will give THESE a try. At first glance, I don’t really see anything related to routing, but I’ll dig a bit deeper and post results… Thank you.
Andrew
(Andrew Saldivar)
January 7, 2022, 10:37pm
5
Very interesting @utaylor , The trace revealed the SSRSEnableRouting
parameter! I added it, set it to true, and Bingo!
Thank you very much!
1 Like
jkane
(John Kane)
January 8, 2022, 2:44pm
6
That’s good to know. My code has nothing about the routing but it does use the routing