Unable to print BAQ Report by REST API

I’m trying to print a Epicor BAQ Report using REST API from another web application. I was able to do similar printing with a standard Epicor Report (a modified Order Ack Report) successfully. When I work on another BAQ Report or even test in Epicor REST API Help page or Postman, the REST API returns a 200 OK Response. However, when I go to the Epicor monitor, the report process shows an error like this:

Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask: An error has occurred during report processing. —> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. —> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset ‘BAQReportParameter’. —> System.Data.SqlClient.SqlException: Invalid column name ‘Cur-TaskClientID’.

I checked in the Report Database, I found that the table dbo.BAQReportParamXXXXXXXXXXX was not created succesfully. I guess this is the reason on the error above. I also wonder if it is a permission problem. But when I use same Epicor account to print the standard Epicor Report through REST API, the other table dbo.RptParameterXXXXXXXX can be created. The account is a security manager in Epicor. Do I need additional permission in the sql server? (I tried also adding the same account with sysadmin rights in the SQL database but it also did not work)

Below is the REST API i used and the dataset I pass in. For the BAQReportParam Filter1, I copied the DynamicReportDataSet from a client trace of printing same report in Epicor.

I have stuck here for a few days and would be much appreciated if someone can offer me some help.

URL: https://{epicor_server}/{epicor_app}/api/v1/Ice.Rpt.BAQReportSvc/SubmitToAgent
Dataset:
{
“ds”: {
“BAQReportParam”: [
{
“BAQID”: “TEST_013_SPARInv”,
“SortBy”: “”,
“SortFields”: “”,
“ReportTitle”: “Invoice”,
“Summary”: false,
“Filter1”: “<DynamicReportDataSet xmlns="http://www.epicor.com/Ice/300/BO/DynamicReport/DynamicReport\”>THK01TEST_SPAR_RptTOMY 013 ShipPlan AR Invoice ReportInvoiceTEST_013_SPARInvfalsefalsefalsefalseTEST_SPAR_RptTEST_SPAR_Rpt.rdl27050725c90c4277-be3c-4247-bad8-6d055b61de700THK01TEST_SPAR_RptUD103Key1=1Ship Plan IDUD103_Key1x(50)3751ef05-7f02-4a0b-9324-9f8107226170truenvarcharfalse027050729a3ee0cc6-c9cf-4466-945a-5efbc7d2748b0000000005Field10",
“UserID”: “annie.cheung”,
“Character01”: “ff2a11eb-106e-41ef-8116-09a078a4738b”,
“BAQRptID”: “TEST_SPAR_Rpt”,
“ReportID”: “TEST_SPAR_Rpt”,
“Option01”: “0000000005”,
“AutoAction”:“SSRSGenerate”,
“PrinterName”: “”,
“AgentSchedNum”: 0,
“AgentID”: “SystemTaskAgent”,
“AgentTaskNum”: 0,
“RecurringTask”: false,
“ReportStyleNum”: 1,
“ArchiveCode”: 1,
“FaxSubject”: “ARINV-100002-20200318”,
“ReportCurrencyCode”: “HKD”,
“ReportCultureCode”: “en-HK”,
“SSRSRenderFormat”: “PDF”,
“PrintReportParameters”: false,
“SSRSEnableRouting”: false,
“DesignMode”: false,
“RowMod”: “A”
}
],
“ReportStyle”: [],
“ExtensionTables”: []},
“agentID”: “SystemTaskAgent”,
“agentSchedNum”: “0”,
“agentTaskNum”: “0”,
“maintProgram”: “Ice.UIRpt.BAQReport”
}

Based on the Ice.SysTaskParam schema, there is no column name called Cur-TaskClientID.

Cur-TaskClientID appears to be a field value inside the ParamName column of the table…

SQL:
select * from [Ice].[SysTaskParam] where ParamName = ‘Cur-TaskClientID’

Thanks for your hint. But how can I provide this “Cur-TaskClientID” to the SysTaskParam table?

I read another article successfully print the BAQ report by REST after passing Cur-TaskClientID to BAQReport Param. (Printing from a uBAQ called via REST fails - #4 by hkeric.wci) I tried but no luck, and I cannot find this parameter from BAQReportParam in the REST API help page too. Is there any more hint to do so? Thank you very much.

I am also having this issue. Has anyone been able to successfully print a BAQ report from the REST API help page? Ice.RPT.BAQReportSvc/SubmitToAgent

Yesterday, I had a call fail, and found that I needed to change the url address from an http:// to https://.

@tmastern , but were you successfully able to print a BAQ report from the rest call Ice.RPT.BAQReportSvc/SubmitToAgent ?

Sorry for the late reply…
No, I was simply calling a baq report from BaqSvc.

Thanks

Utah, not sure if you are still looking into this but I had to work on this for somebody and got something to work. This call does a print preview and pops up on my workstation but should work for printing or whatever else you might be looking to do:


Adam thank you for posting this! I am not working on that anymore, but I still will need it in the future.

At insights I learned how to use the business objects to print a report via a function as well so I was going to go that route too!

Thank you! :pray: Hope you are well, we need to catch up soon. Would like to hear about the cool projects you are working on.

1 Like