триггер показать данные из-за пределов iframe

Я встраиваю отчеты powerBi в веб-приложение angular 7, мы используем Powerbi-Client для связи с фреймом и PowerBi. Мне нужны две вещи:

  1. Как скрыть контекстное меню или запретить использование контекстного меню при щелчке правой кнопкой мыши по отчету.
  2. Как я могу активировать опцию «Показать данные» из-за пределов IFrame.

Спасибо


person Mhand7    schedule 07.11.2018    source источник


Ответы (1)


Для данных шоу вы можете использовать данные экспорта:

// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;

// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];

// Get a reference to the embedded report.
report = powerbi.get(embedContainer);

// Retrieve the page collection and get the visuals for the first page.
report.getPages()
  .then(function (pages) {

    // Retrieve active page.
    var activePage = pages.find(function(page) {
      return page.isActive
    });

    activePage.getVisuals()
      .then(function (visuals) {

        // Retrieve the wanted visual.
        var visual = visuals.find(function(visual) {
          return visual.name == "VisualContainer4";
        });

        // Exports visual data
        visual.exportData(models.ExportDataType.Summarized)
          .then(function (result) {
            Log.logCsv(result.data);
          })
          .catch(function (errors) {
            Log.log(errors);
          });
        })
        .catch(function (errors) {
          Log.log(errors);
        });
  })
  .catch(function (errors) {
    Log.log(errors);
  });
            .catch(errors => {
                console.log(errors.message);
            });

В log.logCsv(result.data) вы можете манипулировать данными, чтобы делать все, что хотите, вне iframe pbi.

person zahma    schedule 08.11.2018