Highlighted

Delivery Summary Report - Campaign level

asktam1410

06-12-2018

Hi ,

I am trying to generate delivery summary report at campaign level through workflow. report is generated with the comments of "No deliveries". But there are 4 deliveries belong to this campaign

  var campId=204935052;

      var reportName = "deliveryStatistics";

      var path = "/usr/local/neolane/nl6/var/xxxxxxxxxx/export/"+"DeliverySummary_"+"Ashok_Test"+i+".xls";

      var exportFormat = "XLS";

      isAdHoc = false;

      var _ctx = <ctx _context="selection" _selectionCount="1" _selection={campId} _schema="nms:operation" _reportContext={reportName} />

      xtk.report.export(reportName,_ctx,exportFormat,path,isAdHoc);

Could you please help to debug the attached code.

Thanks,

Ashok S

Replies

Highlighted

Jean-Serge_Biro

MVP

07-12-2018

Hi Ashok,

I think you want to use _schema="nms:delivery" instead of _schema="nms:operation", don't you?

Regards
J-Serge

Highlighted

asktam1410

07-12-2018

I believe if we use _schema="nms:delivery" then it would generate report at delivery level. My requirement is produce delivery summary report at campaign level.

for example , if we have 4 deliveries are executed to the same campaign , i want all 4 of them when i pass operation-id.

Highlighted

Jean-Serge_Biro

MVP

10-12-2018

Hi Ashok,

The report deliveryStatistics only takes 1 or several deliveries Id as input parameter (_selection).

So it must be _schema="nms:delivery" in your queryDef.

But if you don't want to collect the operation deliveries ID before your JS code, and keep _schema="nms:operation" and operation ID as _selection input parameter, in that case, you should use the report internal name operationStatistics instead of deliveryStatistics:

1643187_pastedImage_0.png

Regards
JS

Highlighted
Highlighted

asktam1410

10-12-2018

Thank you. I even tried operationstatistics option before posting it here. But somehow it was not working.

Created custom specific report using the existing delivery summary report and it got worked as expected.

Thank you for all your valuable options.

Just for FYI. Below is the code i tried to use it for the  operationstatistics.

var reportName = "deliveryStatistics";

var path = "/usr/local/neolane/nl6/var/xxxxxxxxx/export/"+"DeliverySummary_"+"Ashok_Test"+".xls";

var exportFormat = "XLS";

isAdHoc = false;

var _ctx = <ctx _context="selection" _selection={operation_id} _schema="nms:opertion" _reportContext={reportName} />

xtk.report.export(reportName,_ctx,exportFormat,path,isAdHoc);