没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|行业资讯|编辑:龚雪|2022-08-26 10:26:34.620|阅读 69 次
概述:本文将着重为解决前端 Web 开发人员的需求,创建第一个Vite支持的Web应用,欢迎下载相关工具体验!
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
Vite 是一个基于开发服务器的构建工具,它在启动应用程序之前组装 JavaScript 代码,同时Vite还有助于在进行更改时减少加载速度,并允许您几乎可以立即查看结果。
在这篇文章中,我们将解决前端 Web 开发人员的需求,并向您展示如何使用 Vite 库来显着提高 Javascript 客户端应用程序的启动/更新速度。
Vite将代码创建为ES模块——现代浏览器可以用来加载JavaScript的模块,在依赖较大的情况下,Vite 会预先捆绑这些模块,以减少浏览器对 Web 服务器的请求数量。在以下部分中,我们将向您展示如何将Vite添加到由DevExtreme提供支持的React Reporting应用程序中。
在上文中,我们已为大家介绍如何创建示例DevExtreme应用、配置应用程序来使用Vite和DevExpress Reports,具体步骤可点击查看回顾>>
接下来我们将继续介绍如何添加DevExpress Document Viewer和Report Designer组件等。
添加Document Viewer的步骤
将 src/pages/document-viewer/document-viewer.tsx 文件内容替换为以下内容:
import React from 'react'; import ko from 'knockout'; import 'devexpress-reporting/dx-webdocumentviewer'; import './document-viewer.scss'; class ReportViewer extends React.Component { constructor(props) { super(props); this.viewerRef = React.createRef(); this.reportUrl = ko.observable("Invoice"); this.requestOptions = { host: "//localhost:5001/", invokeAction: "DXXRDV" }; } render() { return (<div ref={this.viewerRef} data-bind="dxReportViewer: $data"></div>); } componentDidMount() { ko.applyBindings({ reportUrl: this.reportUrl, requestOptions: this.requestOptions }, this.viewerRef.current); } componentWillUnmount() { ko.cleanNode(this.viewerRef.current); } }; export default () => ( <React.Fragment> <h2 className={'content-block'}>Document Viewer</h2> <div className={'content-block'}> <div className={'dx-card responsive-paddings'}> <div style={{ width: "100%", height: "700px" }}> <ReportViewer /> </div> </div> </div> </React.Fragment> );
以下属性指定报表名称:
this.reportUrl = ko.observable("Invoice");
主机指定服务器端应用地址:
host: //localhost:5001/
最后在 src/pages/document-viewer/document-viewer.scss 页面添加如下内容:
@import url("../../../node_modules/jquery-ui/themes/base/all.css"); @import url("../../../node_modules/devextreme/dist/css/dx.material.orange.light.css"); @import url("../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.common.css"); @import url("../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.material.orange.light.css"); @import url("../../../node_modules/devexpress-reporting/dist/css/dx-webdocumentviewer.css");
添加DevExpress Report Designer的步骤
将 src/pages/report-designer/report-designer.tsx 文件内容替换为以下内容:
import React from 'react'; import ko from 'knockout'; import 'devexpress-reporting/dx-reportdesigner'; import './report-designer.scss'; class ReportDesigner extends React.Component { constructor(props) { super(props); this.designerRef = React.createRef(); this.reportUrl = ko.observable("Invoice"); this.requestOptions = { host: "//localhost:5001/", getDesignerModelAction: "/DXXRD/GetDesignerModel" }; } render() { return (<div ref={this.designerRef} data-bind="dxReportDesigner: $data"></div>); } componentDidMount() { ko.applyBindings({ reportUrl: this.reportUrl, requestOptions: this.requestOptions }, this.designerRef.current); } componentWillUnmount() { ko.cleanNode(this.designerRef.current); } }; export default () => ( <React.Fragment> <h2 className={'content-block'}>Report Designer</h2> <div className={'content-block'}> <div className={'dx-card responsive-paddings'}> <div style={{ width: "100%", height: "700px" }}> <ReportDesigner /> </div> </div> </div> </React.Fragment> );
以下属性指定报表名称:
this.reportUrl = ko.observable("Invoice");
主机指定服务器端应用地址:
host: //localhost:5001/
因此,将以下内容添加到 src/pages/report-designer/report-designer.scss 页面以完成此步骤:
@import url("../../../node_modules/jquery-ui/themes/base/all.css"); @import url("../../../node_modules/devextreme/dist/css/dx.material.orange.light.css"); @import url("../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.common.css"); @import url("../../../node_modules/@devexpress/analytics-core/dist/css/dx-analytics.material.orange.light.css"); @import url("../../../node_modules/@devexpress/analytics-core/dist/css/dx-querybuilder.css"); @import url("../../../node_modules/devexpress-reporting/dist/css/dx-webdocumentviewer.css"); @import url("../../../node_modules/devexpress-reporting/dist/css/dx-reportdesigner.css");
Web报表组件需要一个后端应用程序来存储和处理报告,运行后端应用程序以确定地址,并将该地址分别指定为 src/pages/document-viewer/document-viewer.tsx和src/pages/report-designer/report-designer中 ReportViewer和ReportDesigner组件的主机选项.tsx文件。
如果您刚刚创建了一个后端应用程序,可以从模板中创建一个TestReport,除了这个简单的报告,您还可以加载我们的发行版附带的报表。要加载报表,请在官方的WinForms Reporting演示中打开 Invoice 模块,切换到 Designer,然后将报表另存为REPX文件。在Visual Studio Report Designer中打开TestReport 报表,然后单击报表智能标记中的打开/导入以加载您保存的REPX文件。
确保后端应用程序正在运行,导航到devextreme-react-sample文件夹,然后执行以下命令:
npm install
npm run start
完成后,应用程序应如下所示:
DevExpress技术交流群6:600715373 欢迎一起进群讨论
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@wqylolg.cn
文章转载自:慧都网通过本次更新,HOOPS Exchange不仅强化了对各类主流文件格式的支持,增强了跨平台的兼容性和稳定性,还为用户提供了更便捷、更高效的功能体验,进一步巩固了其在3D数据转换和交换领域的领先地位。
在工业和建筑领域,CAD 文件的处理至关重要。CADViewX 作为一款功能强大的 ActiveX 组件,能够为应用程序注入高效的 CAD 处理能力,助力企业和开发者轻松应对各类 CAD 文件操作需求。
在现代 Web 应用开发领域,Syncfusion 公司的 Essential Studio for JavaScript 脱颖而出,成为开发者构建高效、美观应用的得力助手。它不仅提供了丰富的 UI 组件库,还深度融合了性能优化与跨平台支持,帮助企业快速实现复杂业务需求。以下从功能特点、核心优势和应用场景三方面展开,带您全面了解这一工具。
工业3D应用开发,既要建模好、也要可视化强,选对技术栈非常关键。希望这篇对比能帮你理清选型方向,少踩坑、快上线!
优秀的界面控件开发包,帮助企业构建卓越应用!
DevExpress DXperience Subscription高性价比的企业级.NET用户界面套包,助力企业创建卓越应用!
DevExtreme Complete Subscription高性能HTML5/JavaScript开发框架,利用现代Web开发堆栈构建优异性能的应用程序。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@wqylolg.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢