I have a couple questions about this topic:
-
What is the reason for Data Type discrepancy between DynamicReportDataSet and DynamicReportTableset? In my Post-Processing Method Directive, I don’t have access to the DynamicReportDataSet. Am I missing an assembly reference?
-
It seems that Filter1 is an XML representation of the DynamicReportDataSet Object. Is this incorrect? I’m being told that no XML should be needed.
I’ve seen some version of this solution in a couple different threads:
Ice.Contracts.DynamicReportSvcContract dynamicReport = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.DynamicReportSvcContract>(Db);
Ice.Contracts.BAQReportSvcContract baqReport = Ice.Assemblies.ServiceRenderer.GetService<Ice.Contracts.BAQReportSvcContract>(Db);
var rptTs = dynamicReport.GetByID("InvLabel");
DynamicReportDataSet rptDs = new DynamicReportDataSet();
DatasetAdapter.CopyTSTableToDataTable<BAQReportRow, DynamicReportDataSet.BAQReportDataTable>(rptTs.BAQReport, rptDs.BAQReport);
DatasetAdapter.CopyTSTableToDataTable<BAQRptFilterRow, DynamicReportDataSet.BAQRptFilterDataTable>(rptTs.BAQRptFilter, rptDs.BAQRptFilter);
DatasetAdapter.CopyTSTableToDataTable<BAQRptOptionFldRow, DynamicReportDataSet.BAQRptOptionFldDataTable>(rptTs.BAQRptOptionFld, rptDs.BAQRptOptionFld);
DatasetAdapter.CopyTSTableToDataTable<BAQRptSortRow, DynamicReportDataSet.BAQRptSortDataTable>(rptTs.BAQRptSort, rptDs.BAQRptSort);
DatasetAdapter.CopyTSTableToDataTable<BAQRptSortFldRow, DynamicReportDataSet.BAQRptSortFldDataTable>(rptTs.BAQRptSortFld, rptDs.BAQRptSortFld);
rptDs.AcceptChanges();
StringWriter writer = new StringWriter();
rptDs.WriteXml(writer);
var baqRptDS = baqReport.GetNewBAQReportParam("InvLabel");
baqRptDS.BAQReportParam[0].BAQRptID = "InvLabel";
baqRptDS.BAQReportParam[0].BAQID = "InventoryLabelData";
baqRptDS.BAQReportParam[0].AutoAction ="SSRSClientPrint";
baqRptDS.BAQReportParam[0].WorkstationID = workstationID;
baqRptDS.BAQReportParam[0].AgentID = "Main";
baqRptDS.BAQReportParam[0].RptPrinterSettings = Regex.Replace(printerSettings, @"Copies=\d*", @"Copies=" + quantity.ToString() );
baqRptDS.BAQReportParam[0].Filter1 = writer.ToString();
baqReport.SubmitToAgent(baqRptDS, "Main", 0, 0, "Ice.UIRpt.BAQReport;InvLabel");
Here’s a summation of my solution which appears to do the same thing from what I can tell:
DynamicReportSvcContract dynrptsvc = Ice.Assemblies.ServiceRenderer.GetService<DynamicReportSvcContract>(Db);
BAQReportSvcContract baqrptsvc = Ice.Assemblies.ServiceRenderer.GetService<BAQReportSvcContract>(Db);
DynamicReportTableset drTS = dynrptsvc.GetByID(baQRptID);
JObject drTSJObj = JObject.FromObject(drTS);
XmlDocument drTSxml = (XmlDocument)JsonConvert.DeserializeXmlNode(drTSJObj.ToString(), "DynamicReportDataSet");
BAQReportTableset brTS = baqrptsvc.GetNewBAQReportParam(baQRptID);
brTS.BAQReportParam[0].BAQID = drTS.BAQReport[0].ExportID;
brTS.BAQReportParam[0].ReportTitle = drTS.BAQReport[0].FormTitle;
brTS.BAQReportParam[0].AgentID = defaultAgentID;
brTS.BAQReportParam[0].UserID = Session.UserID;
brTS.BAQReportParam[0].WorkstationID = Session.ClientComputerName;
brTS.BAQReportParam[0].BAQRptID = baQRptID;
brTS.BAQReportParam[0].Option01 = PrintQty.ToString();
brTS.BAQReportParam[0].AutoAction = PrintAction;
brTS.BAQReportParam[0].Filter1 = drTSxml.OuterXml;
baqrptsvc.SubmitToAgent(brTS, defaultAgentID, 0, 0, String.Format("{0};{1}", maintProgram, baQRptID));
Can someone please help clarify the requirement for Filter options for me, and why some are using DynamicReportDataSet, but it doesn’t seem available in BPM.