2017-03-24 2 views
2

JavaScript를 사용하여 주어진 보고서 이름의 보고서가 있는지 확인하는 것이 편리합니까?JS로 보고서 표시 : 보고서가 있는지 확인하는 방법?

보고서를 표시하는 방법에 대한 this 공식 가이드 뒤에 나는 URL에 주어진 이름으로 보고서를 표시 할 수있었습니다. 주어진 보고서 이름이 보고서와 일치하지 않는 경우 나 오류 얻을 :

Could not open successfully the report 'fake-name' (The report '/shared/fake-name.icc-report (null)' does not exists.) 

그래서 내가 보고서가없는 존재 않을 경우 사용자를 리디렉션 할을하고 내가 나를 참 또는 거짓 제공하는 기능과 같은 뭔가가 필요 보고서 이름을 기반으로합니다.

이 작업을 수행 할 수있는 방법이 있습니까?

감사합니다. :)

답변

3

내가 openReport 콜백에 액세스 할 수 있도록이 옵션을 사용하는 것이 좋습니다 :

var options = { 

     root: ic3root, 
     rootLocal: ic3rootLocal, 
     imagesPath: 'images', 

     //librariesMode:'dev', 

     callback: function() { 

      $('#intro').remove(); 

      var ic3reporting = new ic3.Reporting(
        { 
         noticesLevel: ic3.NoticeLevel.ERROR, 

         dsSettings: { 
          url: "http://<your_domain>/icCube/gvi" 
         } 
        }); 

      ic3reporting.setupGVIConfiguration(function() { 
       ic3reporting.setupApplication(
         { 
          mode: ic3.MainReportMode.REPORTING, 
          hideTopPanel: true, 
          noticesLevel: ic3.NoticeLevel.ERROR, 
          container: $("#container") 
         }); 

       ic3reporting.openReport({ 
        report: { 
         name: 'shared/report23' 
        } 
       }, function (reportState) { 
        var reportExists = _.isEmpty(ic3reporting.reportName()); 
       }) 

      }); 
     } 
    }; 

    ic3ready(options); 

당신이 경우에 "reportExists을"사용자를 리디렉션 할 수 있습니다 false를

같음