包含分发时QlikView Management API出错

时间:2016-07-12 20:19:43

标签: c# .net qlikview

您好我已经使用QMS API创建了一个任务,并且已成功填充所有常规,重新加载和减少标签但我现在在使用分发类别时遇到了麻烦。我试图"分发到QlikView Server"并添加要分发到的用户的视图。除非我在DocumentTaskScope(DocumentTaskScope.Distribute)中包含分发,否则该任务似乎将丢失对SourceDocument的引用,并且reduce类别将被删除,以及来自general和reload的选项将丢失。当我在分发选项卡上单击管理用户时,此对话框会显示此信息。 enter image description here

此外,我的发布面板实际上是这样的,因为您可以看到它缺少"分发给QlikView Server"通常应该在那里的区域:

enter image description here

这是我的分发部分的代码,我在c#编写这个程序,程序构建和执行没有错误,它只是没有产生预期的结果。

我在想它是否与服务器名称语法或ID成员有关。文档表明这是QlikView服务器的ID。 ",所以我使用了qlikview服务的id,但我不确定这是它正在寻找的。

//Distribute static ("Manually" in QV Management Console)

        DocumentTask.TaskDistribute.TaskDistributeStatic tds = new DocumentTask.TaskDistribute.TaskDistributeStatic();



        TaskDistributionDestination.TaskDistributionDestinationQlikViewServer tddqvs = new TaskDistributionDestination.TaskDistributionDestinationQlikViewServer();

        tddqvs.Name = "QVS@qlikviewdev";

        tddqvs.Mount = "Root Folder";

        tddqvs.ID = qvsGuid;



        TaskDistributionEntry newEntry = new TaskDistributionEntry();

        newEntry.Destination = new TaskDistributionDestination();

        TaskDistributionDestination tdd = new TaskDistributionDestination();

        TaskDistributionDestinationType tddt = new TaskDistributionDestinationType();

        tddt = TaskDistributionDestinationType.QlikViewServer;

        newEntry.Destination.Type = tddt;

        newEntry.Destination.QlikViewServer = tddqvs;

        TaskDistributionDestination.TaskDistributionDestinationFolder tddf = new TaskDistributionDestination.TaskDistributionDestinationFolder();

        tddf.Name = "N/A";

        newEntry.Destination.Folder = tddf;



        DirectoryServiceObject[] serviceObject = new DirectoryServiceObject[2];

        DirectoryServiceObject dso1 = new DirectoryServiceObject();

        DirectoryServiceObject dso2 = new DirectoryServiceObject();

        dso1.Name = "QlikView_Admin";

        dso1.Type = DirectoryServiceObjectType.Named;

        dso1.OtherProperty = "N/A";

        dso2.Name = "Qlikview_PowerUser";

        dso2.Type = DirectoryServiceObjectType.Named;

        dso2.OtherProperty = "N/A";

        serviceObject[0] = dso1;

        serviceObject[1] = dso2;

        newEntry.Recipients = serviceObject;



        TaskDistributionEntry[] tdeArray = new TaskDistributionEntry[1];

        tdeArray[0] = newEntry;





        tds.DistributionEntries = tdeArray;



        docTask.Distribute = new DocumentTask.TaskDistribute();

        docTask.Distribute.Static = tds;





        DocumentTask.TaskDistribute.TaskDistributeDynamic taskDistributeDynamic = new DocumentTask.TaskDistribute.TaskDistributeDynamic();



        taskDistributeDynamic.Destinations = new List<TaskDistributionDestination>().ToArray();

        taskDistributeDynamic.FieldName = string.Empty;

        taskDistributeDynamic.IdentityType = UserIdentityValueType.DisplayName;



        docTask.Distribute.Dynamic = taskDistributeDynamic;



        DocumentTask.TaskDistribute.TaskDistributeNotification tdn = new DocumentTask.TaskDistribute.TaskDistributeNotification();

        tdn.SendNotificationEmail = false;

        docTask.Distribute.Notification = tdn;



        DocumentTask.TaskDistribute.TaskDistributeOutput tdo = new DocumentTask.TaskDistribute.TaskDistributeOutput();

        tdo.Type = TaskDistributionOutputType.QlikViewDocument;



        docTask.Distribute.Output = tdo;

1 个答案:

答案 0 :(得分:1)

原来我在TaskDistributionDestinationQlikViewServer Objects的ID字段中使用了错误的GUID。一旦我将它设置为QVS @(服务器名称)服务的ID,它就可以工作。