Sometimes I have the error: qt.engine is null.
And sometimes I have the errors: this.components.getByIndex(...).as(...) is null.
t.dataBandInfo.groupHeaders is null
my code is like this:
Code: Select all
$scope.teste = function () {
var model = [{
identificacaoConsulta: "analytics.consultaBasicaDashboard",
filtros: []
},
{
identificacaoConsulta: "analytics.consultaBasica",
filtros: []
}];
PainelService.obterOpecJson()
.then(function (response) {
$scope.dashboardOpec = response.data;
$scope.createViewer();
$scope.setSelectedDashboardButton("DashboardOpec");
viewer.showProcessIndicator();
var dashboard = Stimulsoft.Report.StiReport.createNewDashboard();
dashboard.load($scope.dashboardOpec);
PainelService.ObterConsultaInfos(model)
.then(function (response) {
var consultaInfos = response.data;
for (i = 0; i < consultaInfos.length; i++) {
var modelTeste = {
identificacaoConsulta: consultaInfos[i].identificacaoConsulta,
filtros: []
};
$scope.obterDadosDashboard(modelTeste, consultaInfos[i], dashboard);
}
});
});
}
$scope.obterDadosDashboard = function (modelTeste, consultaInfos, dashboard) {
PainelService.ObterDadosDashboards(modelTeste)
.then(function (response) {
$scope.dashboardDados = response.data;
var dashboardDados = {};
dashboardDados[consultaInfos.nomeDataSet] = $scope.dashboardDados;
var dataSet = new Stimulsoft.System.Data.DataSet(consultaInfos.nomeDataSet);
dataSet.readJson(dashboardDados);
viewer.report = dashboard;
dashboard.dictionary.databases.clear();
dashboard.regData(consultaInfos.nomeDataSet, consultaInfos.nomeDataSet, dataSet);
dashboard.dictionary.synchronize();
});
}
$scope.createViewer = function () {
var options = new Stimulsoft.Viewer.StiViewerOptions();
options.height = "100%";
options.appearance.scrollbarsMode = true;
options.toolbar.showDesignButton = true;
// Create an instance of the viewer
viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
viewer.renderHtml("stiRightPanel");
}
(*I'm Brazilian, so what's in Portuguese are just variable and method names)