轉(zhuǎn)帖|使用教程|編輯:莫成敏|2020-03-10 10:39:28.533|閱讀 488 次
概述:在本文中,我們主要介紹了如何在Angular 框架中使用 ActiveReportsJS Viewer 控件來創(chuàng)建 Web應(yīng)用。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
ActiveReportsJS 是一款基于 HTML5 的純前端報表控件,采用拖拽式報表開發(fā)模式,無需任何服務(wù)器和組件支持,即可在 Mac、Linux 和 Windows 平臺中,輕松設(shè)計中國式復(fù)雜報表、類 Excel/Word 報表、DashBoard 儀表板等多種報表類型。其完美繼承了 .NET報表控件 ActiveReports 的報表設(shè)計能力和高效的報表開發(fā)引擎,并可深度集成并全面嵌入到 Vue、Angular、React 等前端開發(fā)框架中。
在本文中,我們主要介紹了如何在Angular 框架中使用 ActiveReportsJS Viewer 控件來創(chuàng)建 Web應(yīng)用。
必要文件
1、通過在命令控制臺中輸入以下命令來新建Angular CLI應(yīng)用程序
ng new arjs-angular --defaults
2、將此目錄設(shè)為工作目錄
cd arjs-angular
3、將此目錄設(shè)為工作目錄
yarn add @grapecity/activereports
4、導(dǎo)入ActiveReportsJS樣式為到 'src/styles.css'文件,為全局樣式
@import '@grapecity/activereports/styles/ar-js-viewer.css';
5、修改 'src/app/app.component.html' 文件創(chuàng)建 'ARJSviewerDiv' div:
<h1>ActiveReportsJS Viewer using Angular-CLI</h1> <div id="ARJSviewerDiv" style="height: 100%;"><div>
6、修改 src/app/app.component.ts 文件:
import { Component } from '@angular/core'; import { Viewer } from '@grapecity/activereports/viewer'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'arjsviewer-angular-cli app'; ngOnInit() { let v = new Viewer('#ARJSviewerDiv'); v.open({ Type: 'report', Body: { Name: 'Body', Type: 'section', ReportItems: [ { Type: 'textbox', Name: 'textbox1', Value: 'Hello from ActiveReportsJS', Height: '10in' } ] }, Name: 'Report' }); } }
7、在命令控制臺中,輸入以下命令以運行該應(yīng)用程序
ng serve
您將在瀏覽器中中查看到運行的應(yīng)用程序。
本教程內(nèi)容到這里就完結(jié)了,想要了解更多產(chǎn)品資訊請繼續(xù)關(guān)注我們慧都網(wǎng)~如果您對輕量級Web報表工具ActiveReportsJS感興趣,您可以點擊這里下載試用版~
相關(guān)內(nèi)容推薦:
ActiveReportsJS入門教程:如何在PureJS 框架中使用 ActiveReportsJS創(chuàng)建 Web應(yīng)用
輕量級Web報表工具ActiveReportsJS入門教程:如何使用設(shè)計器創(chuàng)建報表
純前端報表控件 ActiveReportsJS入門教程:如何將ActiveReportsJS的強(qiáng)大功能嵌入到Web應(yīng)用
想要購買ActiveReportsJS正版授權(quán),或了解更多產(chǎn)品信息請點擊
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: