发布时间:2026-07-21阅读(1)
在实际的应用场景中,经常会有这样的情况,机器中本身自带的字体不能满足特殊字节的显示。特别是化工行业、建筑行业、金属行业特殊符号用的特别多。这时候为了满足实际应用中的这些特殊字符的问题,就会自定义一份字体文件,在进行报表设计的时候进行调用。
文末点击“了解更多”获取工具下载
现在我们就来讲解如何进行自定义文字的调用:
1. 首先就是安装字体,需要把字体安装在对应的路径下,具体路径如下:C:\Windows\Fonts

2. 如果是使用桌面端设计器,你在此处安装了对应的字体文件之后,在桌面端的设计器中就可以调用该字体,这里我调用的是一个 特殊的字体“SJQY”钢材建筑行业使用的一个特殊字体。

3. 但是在web端设计中,不进行API的设置是没办法调用该字体的,具体API的调用的方法如下其中 Arial,SJQY,Times New Roman 代表字体的命名。
designerOptions.fonts = [Arial,SJQY,Times New Roman];<script>var designerOptions = GrapeCity.ActiveReports.WebDesigner.createDesignerOptions();designerOptions.server.url = api;designerOptions.reportInfo = @reportId ? { id: @reportId } : null;designerOptions.openButton.visible = true;designerOptions.saveButton.visible = true;designerOptions.saveAsButton.visible = true;// Used in About dialog and File View Help tab.designerOptions.documentation.home = https://www.grapecity.com/activereports/docs/v15/online-webdesigner/overview.html;// Used in notifications about report items transformation.designerOptions.documentation.reportItemsTransformation = https://www.grapecity.com/activereports/docs/v14/online-webdesigner/supportedcontrols.html;designerOptions.reportItemsFeatures.table.autoFillFooter = true;var viewer = null;designerOptions.openViewer = function (options) {if (viewer) {viewer.openReport(options.reportInfo.id);return;}viewer = GrapeCity.ActiveReports.JSViewer.create({locale: options.locale,element: # options.element,reportService: {url: api/reporting,},reportID: options.reportInfo.id,settings: {zoomType: FitPage},});};designerOptions.fonts = [Arial,SJQY,Times New Roman];designerOptions.dataTab.dataSets.canModify = true;designerOptions.dataTab.dataSources.canModify = true;GrapeCity.ActiveReports.WebDesigner.renderApplication("designer-id", designerOptions);</script>
4. 预览结果

本文转载自葡萄城官网
上一篇:最强的编程语言聊一聊编程语言
下一篇:如何注册qq号 怎样注册qq号
Copyright © 2024 有趣生活 All Rights Reserve吉ICP备19000289号-5 TXT地图HTML地图XML地图