轉(zhuǎn)帖|使用教程|編輯:龔雪|2015-08-11 09:18:37.000|閱讀 650 次
概述:ActiveReports報(bào)表控件教程之如何使用JSP程序調(diào)用it
# 界面/圖表報(bào)表/文檔/IDE等千款熱門(mén)軟控件火熱銷(xiāo)售中 >>
相關(guān)鏈接:
ActiveReports報(bào)表解決方以提供.NET報(bào)表所需的全部報(bào)表設(shè)計(jì)和管理功能先于同類(lèi)產(chǎn)品。ActiveReports可在.NET多個(gè)平臺(tái)無(wú)縫遷移,也能擴(kuò)展到Java/PHP/Node.js等Web應(yīng)用。對(duì)IE/Chrome/Firefox/Safari有良好的兼容能力,并支持平板電腦、智能手機(jī)等移動(dòng)設(shè)備。
本文主要介紹如何使用JSP程序調(diào)用ActiveReports報(bào)表。
在Visual Studio 2013中成功編譯ActiveReports項(xiàng)目。并將該項(xiàng)目部署至IIS服務(wù)器。在Defalu Web Site下新建dotnetar。
應(yīng)用程序池設(shè)置如下:
在前臺(tái)建立Html頁(yè)面,調(diào)用關(guān)鍵代碼
var viewer = GrapeCity.ActiveReports.Viewer({ element: '#viewerContainer', reportService: { url: 'WebService1.asmx' }, uiType: 'desktop', reportLoaded : function () { reportsButtons.prop('disabled', false); } });
由于是跨域訪問(wèn),需要打開(kāi)相關(guān)限制。新建Global.asax,增加以下代碼
protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); if (HttpContext.Current.Request.HttpMethod == "OPTIONS") { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS"); HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept"); HttpContext.Current.Response.End(); } }
部署成功后,在瀏覽器輸入//localhost/DotNetAR/WebService1.asmx
顯示頁(yè)面如下:
JSP調(diào)用代碼如下
var viewer = GrapeCity.ActiveReports.Viewer( { element : '#viewerContainer', reportService : { url : '//localhost/DotNetAR/WebService1.asmx' }, uiType : 'desktop', reportLoaded : function() { reportsButtons.prop('disabled', false); } });
將WebRoot項(xiàng)目部署至Tomcat下。
IIS運(yùn)行如下圖:
Tomcat運(yùn)行如下圖:
最新版下載:ActiveReports v9
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自:慧都控件網(wǎng)