Trying to preview a report on button click event and it goes into Scheduled Task

Hello All,

Am trying to preview a report on button click event and it goes into scheduled task please see below…when I do it through print form it works as expected …i have restated the task agent as well but still it goes to scheduled task…

We are on 10.2.4.4

Erp.Proxy.Rpt.QuotFormImpl QFForm = WCFServiceSupport.CreateImpl<Erp.Proxy.Rpt.QuotFormImpl>((Ice.Core.Session)oTrans.Session, Erp.Proxy.Rpt.QuotFormImpl.UriPath);

Erp.Rpt.QuotFormDataSet ARInvDs = QFForm.GetNewParameters();

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“QuoteNum”] = 116522;//109;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“AutoAction”] = “SSRSPREVIEW”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“PrinterName”] = “”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“AgentSchedNum”] = 0;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“AgentID”] = “SystemAgent”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“AgentTaskNum”] = 0;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“RecurringTask”] = “False”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“RptPageSettings”] = “”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“RptPrinterSettings”] = “”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“ReportStyleNum”] = 2;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“WorkstationID”] = ((Ice.Core.Session)oTrans.Session).UserID;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“DateFormat”] = “dd/mm/yyyy”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“NumericFormat”] = “,.”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“ProcessTaskNum”] = “0”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“ReportCultureCode”] = “en-GB”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“ReportCurrencyCode”] = “GBP”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“ArchiveCode”] = “0”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“DecimalsGeneral”] = “2”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“DecimalsCost”] = “5”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“DecimalsPrice”] = “5”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“GlbDecimalsGeneral”] = “2”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“GlbDecimalsCost”] = “5”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“GlbDecimalsPrice”] = “5”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“FaxSubject”] = “”;//"";

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“FaxTo”] = “”;

ARInvDs.Tables[“QuoteFormParam”].Rows[0][“SSRSRenderFormat”] = “PDF”;

QFForm.SubmitToAgent(ARInvDs, “SystemAgent”, 0, 0, “Erp.UIRpt.QuotForm”); //Erp.UIRpt.QuotForm

workstation id is not the user id. its configured in the company maintenance. change workstation element to like below.

WorkstationID = Ice.Lib.Report.EpiReportFunctions.GetWorkStationID((Ice.Core.Session)oTrans.Session);

Thanks for the reply.I will try and let you know

I tried and it’s still goes to Scheduled Task

Close the application
Restart the task agent

We done that already

Try this one more time

And pls confirm have you created system task in admin console ?

your passing lot of the element information as text i.e recurringtask/archivecode etc… do a trace log, identify the data type and apply the same on your code. use below below post for reference.

Thanks Prakash… We tried in some other environment it worked and we are checking some configuration of System Agent.

As you suggested we also restarted the Task Agent and tried it didn’t help.

Please let me know if you have any other thoughts…

Even previews need to go through the scheduler. They just typically get scheduled to the “Immediate” (Run now) schedule.

Edit

After appearing on the Scheduled Task tab, does it eventually appear on the Active Task tab?

No, It’s not going to active task remains in schedule task only

run the default report in system and trace the log and compare what the difference between you passing into your custom code.

We did this already and anyway we will check and let you know

No We tried still it appears in scheduled task…

We compared the values are same as is in the trace log…