QlikView Management API erroring when including distribute

泪湿孤枕 提交于 2019-12-13 21:28:33

问题


Hi I have created a task using the QMS API and have had success populating all general, reload, and reduce tabs but I am now having trouble when working with the distribute category. I'm trying to "Distribute to QlikView Server " and add a view users to distribute to. Except whenever I include distribute in the DocumentTaskScope (DocumentTaskScope.Distribute), the task seems to lose reference to the SourceDocument and the reduce category gets wiped, along with options from general and reload being lost. This is indicated by this dialog appearing when I click manage users when on the distribute tab.

Also here is what my distribute panel actually looks like, as you can see it is missing the "Distribute to QlikView Server" area that should normally be there:

Here is my code for the distribute section, I am writing this program in c# and the program builds and executes with no errors, it just doesn't produce the intended result.

I was thinking if it had something to do with the server name syntax or if the ID member. The documentation indicated that this is meant to be the "The ID of the QlikView Server. ", so I used the id of the qlikview service but I am not certain this is what it is looking for.

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


Turns out I was using the wrong GUID for the TaskDistributionDestinationQlikViewServer Objects' ID field. Once I set it to be the ID of the QVS@(servername) service, it worked.



来源:https://stackoverflow.com/questions/38338200/qlikview-management-api-erroring-when-including-distribute

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!