2011-01-20 8 views
2

私はBusiness Objects Web Services SDKを使用してBusiness Objectsデータにアクセスしています。私は正常にレポートのリストを得て、それから以前に実行されたレポートのLastSuccessfulInstanceが見つかりました。しかし、私はLastRunTimeを入力するように見えることはできません。属性が指定されていないクエリを実行すると、設定されていない状態に戻り、特にその属性を要求すると同じ結果が得られます。私はレポート自体とインスタンスを見てきましたが、どちらもこの情報を持っていません。誰が私がどこからそれを得ることができるか知っていますか?ここでBusiness Objects Web Services SDKを使用してレポートのLastRunTimeを取得するにはどうすればよいですか?

は、(SAPのデモの1からハッキング)私のコードです:

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の両方が偽であるとの両方LastRunTime01\01\0001ですが、私はWeb IntelligenceのUIで、最後の実行時間を見ることができます。

+0

質問を、C#で書かれたこのコードはありますか?それはC#としてタグ付けするのに役立つかもしれないからです。それはビジネスオブジェクトのためのコードが非常に少ないのでC# – apereira

+1

@apereiraにあります。はい、そうです。私はタグを追加しました。 –

答えて

2

SAPサポートのTed Uedaの助けを借りて、私はそれを理解しました。

へ:すべてのプロパティは、あなたがすべてを取得するために、クエリ文字列に@*を追加する必要があり、デフォルトで移入されていない、すなわちライン変更

const string query = "path://InfoObjects/Root Folder/Reports/@*"; 
関連する問題