<script> var App = angular.module("MyApp", ["ejangular"]); App.controller('ProductReportController', function ($scope) { $scope.report = true; $scope.samplevalue = "http://" + window.location.host + '/api/ReportApi'; $scope.path = 'RSSMRP01.rdlc'; $scope.Reportdatasources = getDatasource(); $scope.mode = ej.ReportViewer.ProcessingMode.Local; });
function getDatasource() { return [{ value: getData(), name: "DataSet1" }] }
function getData() { var datasource; $.ajax({ dataType: "json", type: "POST", async: false, url: "http://" + window.location.host + "/api/ReportApi/GetDataForReport", success: function (result) { datasource = result; } }); var dataManager = ej.DataManager(datasource); var query = ej.Query().select("Id", "Name"); var reportResult = dataManager.executeLocal(query); return reportResult; } |