ActiveReports是一款纯前端的报表控件,可以集成任何前端页面,现在就详细讲解如何在Html页面进行ActiveReportsJS的集成1、首先新建一个Html页面,然后引入对应的JS和CSS文件
具体引用的JS和CSS文件见附件
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <title>ActiveReportsJS sample</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <link
- rel="stylesheet"
- href="https://cdn.materialdesignicons.com/2.8.94/css/materialdesignicons.min.css"
- />
- <script src="dist/ie-polyfills.js"></script>
- <script src="dist/ar-js-core.js"></script>
- <script src="dist/ar-js-viewer.js"></script>
- <script src="dist/ar-js-pdf.js"></script>
- <script src="dist/ar-js-xlsx.js"></script>
- <script src="dist/ar-js-html.js"></script>
- <script src="report/Audit.js"></script>
- <link
- href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap"
- rel="stylesheet"
- />
- <link
- rel="stylesheet"
- type="text/css"
- href="css/ar-js-ui.css"
- />
- <link
- rel="stylesheet"
- type="text/css"
- href="css/ar-js-viewer.css"
- />
- <style>
- #viewer-host {
- margin: 0 auto;
- width: 100%;
- height: 500px;
- }
- </style>
- </head>
- <body>
- <div id="viewer-host"></div>
- <script>
- const viewer = new ActiveReports.Viewer("#viewer-host", { language: "zh" });
- viewer.open(audit);
- </script>
- </body>
- </html>
复制代码 2、项目运行
3、实例demo见附件
|