BAQ updatable with SSRS report

Good afternoon


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.

tbOrder = (EpiNumericEditor)csm.GetNativeControlReference(“4f1f5d06-c849-4507-bbc1-232bb714d352”);

edvData.dataView[edvData.Row][“field1”] = tbOrder.Text.ToString();
edvData.dataView[edvData.Row][“field2”] = ???; Selected lines “1,2,5,8”

Does anyone have any idea how to take the selected lines from the dashboard to send them as parameters?

1 Like

What format does the report expect the parameters to be in? CSV?

If so, just loop through the rows, check the field, and build that on the fly.

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 expect PDF format, showing the 4 records selected from the Dashboard

No, I meant the filters, I haven’t done a lot of work in that area, so I don’t
know the syntax for the report filters for the row select.

I need something like: IN(@parameters)

Normally use VB style function to hide rows or groups using visibility.

In my SSRS report I have a prmSOLines parameter, how do I generate the parameter statement to send it the values?

// 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

Sentence: Any Idea ???

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.

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");

1 Like

What is The type or namespace name ‘DynamicCriteriaTableset’ does not exist in the namespace ‘Ice.Tablesets’ (are you missing an assembly reference?)

I think you will need to add the assembly Ice.DynamicReport or something similar

It is Ice.Contracts.Rpt.DynamicCriteria.dll

1 Like

I’m having issue with this sentence:

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?)

That was an example of a function (server side). You need a different thing for customizations, have a look at this post:

How can i call the print window?

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.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


You can do a trace while you do those actions manually. Should be able to see the
parameters in it.