那个源码链接我去看看,不知道我本地有没有,你可以根据那个触发事件去写就行: <script type="text/javascript"> $(function () { var paginator = $('#paginator'); var viewer = GrapeCity.ActiveReports.Viewer( { element: '#viewer', report: { id: "Test.rdlx" }, reportService: { url: '/ActiveReports.ReportService.asmx' }, //Setting the uiType to Custom uiType: 'custom', documentLoaded: function () { setPaginator(); }, localeUri: 'Scripts/i18n/Localeuri.txt' }); //Creating the function for Printing $('#btnPrint').click(function () { viewer.print(); }); //Creating the function for Exporting PDF $('#btnExport').click(function () { viewer.export('Pdf', function (uri) { window.open(uri); }, false, {}); }); //Creating the function for Exporting Word $('#btnWord').click(function () { viewer.export('word', function (uri) { window.open(uri); }, false, {}); }); //Creating the function for Exporting excel $('#btnExcel').click(function () { viewer.export('Xls', function (uri) { window.open(uri); }, false, {}); }); //Creating the function for using Paginator control to display report pages and to navigate through them function setPaginator() { if (viewer.pageCount > 0) { for (var i = 1; i <= viewer.pageCount; i++) { $('<li data-bind="' + i + '"><a class="js-page" href="javascript:void(0)">' + i + '</a></li>').appendTo(paginator); } paginator.children(":first").addClass('active'); paginator.children().click(function () { var self = $(this); viewer.goToPage(self.attr('data-bind'), 0, function () { paginator.children().removeClass('active'); self.addClass('active'); }); }); } } });
|