我正在使用Business Objects Web服务SDK来访问我们的Business Objects数据。我已经成功获得了一份报告列表,从中找到了以前运行过的报告的LastSuccessfulInstance。但是,我似乎无法填充LastRunTime。当我执行未指定属性的查询时,它会返回未设置的状态,当我特别要求该属性时,会得到相同的结果。我查看了报告本身和实例,但它们都没有此信息。有谁知道我可以从哪里得到它?

这是我的代码(摘自SAP演示之一):

    var sessConnUrl = serviceUrl + "/session";
    var boConnection = new BusinessObjects.DSWS.Connection(sessConnUrl);
    var boSession = new Session(boConnection);

    // Setup the Enterprise Credentials used to login to the Enterprise System
    var boEnterpriseCredential = new EnterpriseCredential
                                     {
                                         Domain = cmsname,
                                         Login = username,
                                         Password = password,
                                         AuthType = authType
                                     };

    // Login to the Enterprise System and retrieve the SessionInfo
    boSession.Login(boEnterpriseCredential);


    /************************** DISPLAY INBOX OBJECTS *************************/

    // Retrieve the BIPlatform Service so it can be used to add the USER
    var biPlatformUrl = boSession.GetAssociatedServicesURL("BIPlatform");
    var boBiPlatform = BIPlatform.GetInstance(boSession, biPlatformUrl[0]);

    // Specify the query used to retrieve the inbox objects
    // NOTE: Adding a "/" at the end of the query indicates that we want to
    //       retrieve the all the objects located directly under the inbox.
    //       Without the "/" Path operator, the inbox itself would be returned.
    const string query = "path://InfoObjects/Root Folder/Reports/";

    // Execute the query and retrieve the reports objects
    var boResponseHolder = boBiPlatform.Get(query, null);
    var boInfoObjects = boResponseHolder.InfoObjects.InfoObject;

    // If the reports contains a list of objects, loop through and display them
    if (boInfoObjects != null)
    {
        // Go through and display the list of documents
    foreach (var boInfoObject in boInfoObjects)
    {
            var report = boInfoObject as Webi;
            if (report == null)
                continue;

            if (!string.IsNullOrEmpty(report.LastSuccessfulInstanceCUID))
            {
                var instanceQuery = "cuid://<" + report.LastSuccessfulInstanceCUID + ">";
                var instanceResponseHolder = boBiPlatform.Get(instanceQuery, null);
                var instance = instanceResponseHolder.InfoObjects.InfoObject[0];

            }
        }
    }


report.LastRunTimeSpecifiedinstance.LastRunTimeSpecified均为false,两个LastRunTime均为01\01\0001,但是我可以在Web Intelligence UI中看到上次运行时间。

最佳答案

在SAP支持的Ted Ueda的一点帮助下,我找到了解决方案。默认情况下,并非所有属性都已填充,您需要在查询字符串后附加@*以获取所有内容,即更改以下行:

const string query = "path://InfoObjects/Root Folder/Reports/";


至:

const string query = "path://InfoObjects/Root Folder/Reports/@*";

关于c# - 如何使用Business Objects Web Services SDK获取报表的LastRunTime?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4746765/

10-09 03:36