多语言展示
当前在线:1667今日阅读:39今日分享:10

使用ActiveReports与extjs 框架的集成

本贴主要讲述了如何将ActiveReports与Ext框架集成。使得开发项目即具有ext的优点,又具有ActiveReports强大的报表功能。
工具/原料
1

报表工具:ActiveReports报表控件

2

软件大小:44.5M

3

适用平台:全平台

4

开发环境:Visual Studio 2012

方法/步骤
1

新建Web项目,新添加HTML页面,引入所有需要的脚本和资源文件

2

新建RDL报表文件右键添加新建项,添加报表:

3

打开Index.html 页面,添加脚本引用

4

使用Ext初始化页面Ext.create('Ext.panel.Panel', {                title: 'Hello ActiveReports',                width: '80%',                height: 800,                border: true,                html: '

',                dockedItems: [                {                    xtype: 'toolbar',                    name: 'gridToolBar',                    dock: 'top',                    border: false,                    items: [ {                        text: 'BillingInvoice.rdlx', handler: function (button) {                            LoadReport(button);                        }                    }, {                        text: 'Invoice.rpx', handler: function (button) {                            LoadReport(button);                        }                    }, {                        text: 'MoviesReport.rdlx', handler: function (button) {                            LoadReport(button);                        }                    }, {                        text: 'OilProducingCountries.rdlx', handler: function (button) {                            LoadReport(button);                        }                    }                    ]                }],

5

初始化HtmlViewerExt.onReady(function () {            function LoadReport(button) {                var id='Reports/'+ button.text;                var viewer = GrapeCity.ActiveReports.Viewer({                    report: {                        id:id                    },                    element: '#viewerContainer',                    reportService: {                        url: 'Reports/ActiveReports.ReportService.asmx'                    },                    uiType: 'desktop',                    localeUri: 'AR_Res/Scripts/i18n/Localeuri.txt'                });            };

推荐信息