I have an Updateable BAQ inside a Dashboard-Assembly, in this dashboard I am doing a customization to the (Print) button that I add to be able to print an SSRS report, I send the Sales Order parameter to the report and everything is ok, the detail is that I also need to send to the report the lines that they selected through a check(Print) found in the dashboard.
I’m not sure how your SSRS parameters look like but, assuming you already have the order number, add another one OrderLines, text, just like you have it there (“1,2,5,8”). Then, you can use that with row visibility rules in SSRS to hide the lines you don’t want.
Or, you can have a filter parameter in the SSRS report for order lines. You’ll need to pass the params for the lines in XML format. You can do a trace and see exactly what you need.
I’ve never used BAQ reports, but, for SSRS, you need to send the params in XML format in the UserCriteria field. Do a sever trace, run the report and see what it sends there. You’ll need to do the exact same.
Below is an example of calling an SSRS report from a function. It runs the report MyReport, sets the string parameter prmNotification, the output to Excel Data Only and the APR flag to true. You’ll need to amend it but I hope it helps.
/ CALL DYNAMICCRITERIA SERVICE
Ice.Tablesets.DynamicCriteriaTableset tsDCT = new Ice.Tablesets.DynamicCriteriaTableset();
this.CallService<Ice.Contracts.DynamicCriteriaSvcContract>(dcc => {
// get report params
tsDCT = dcc.GetNewDynamicCriteriaReportParam("MyReport");
// set user criteria
string usrcrit;
usrcrit = @"<?xml version=""1.0"" encoding=""utf-8"" standalone=""yes""?><UICriteria><RptCriteriaSet><Company /><RptDefID>MyReport</RptDefID><RptCriteriaSetID>Crit1</RptCriteriaSetID><Description>Criteria1</Description></RptCriteriaSet>";
usrcrit = usrcrit + @"<RptCriteriaPrompt><PromptID>1</PromptID><PromptValue>" + "MyStringValue";
usrcrit = usrcrit + @"</PromptValue><IsToken>false</IsToken><PromptName>prmNotification</PromptName><DataType>nvarchar</DataType><Label>Type</Label></RptCriteriaPrompt></UICriteria>";
tsDCT.DynamicCriteriaParam[0].UserCriteria = usrcrit;
// set other params
tsDCT.DynamicCriteriaParam[0].AutoAction = "SSRSPREVIEW";
tsDCT.DynamicCriteriaParam[0].AgentID = "YourTaskAgentID";
tsDCT.DynamicCriteriaParam[0].SSRSRenderFormat = "Excel-DO";
tsDCT.DynamicCriteriaParam[0].SSRSEnableRouting = true;
// run report
dcc.SubmitToAgent(tsDCT, "YourTaskAgentID", 0, 0, "Ice.UIRpt.DynamicCriteriaReport;" + "MyReport");
// END CALL DYNAMICCRITERIA SERVICE
});
I’m having issue with this sentence:
this.CallService<Ice.Contracts.DynamicCriteriaSvcContract>
It sends me the following error message:
Error: CS1061 - line 97 (256) - ‘Script’ does not contain a definition for ‘CallService’ and no extension method ‘CallService’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)
This code sends the info to pdf, but now I need to send it to excel or csv, any ideas or call the print window?
// Establish your reference to the BAQ Report UI
Ice.UI.Rpt.BAQReport.Transaction trans = new Ice.UI.Rpt.BAQReport.Transaction(oTrans);
// Load the specific BAQ Report by ID you are interested in
trans.LoadBAQReportData("OrderFulfillChk");
//trans.parameters.Add(new ParameterValue() { Name = prmSOLines, Value = parameterValue });
// Fill in the parameters to run the report. You can find these
// by using field help on the BAQ Report dialog.
EpiDataView edvData = (EpiDataView)trans.EpiDataViews["ReportParam"];
edvData.dataView[edvData.Row]["field1"] = tbOrder.Text.ToString();
edvData.dataView[edvData.Row]["field2"] = true;
// Submit to system agent. You can do either a preview or print here
trans.RunDirect("Preview");