Files
XplorePlane/XP.ReportEngine/Documents/App.config.example
T
QI Mingxuan d72b583319 [XP.ReportEngine] 新增 TXT/CSV/Excel 三种报告输出格式支持;Excel (.xlsx) 报告生成器,基于 ClosedXML,支持结构化生成和模板填充两种模式; 新增 XplorePlane_ReportTemplate.xlsx:Excel 报告模板文件。
[XP.ReportEngine] 模型与配置扩展:ReportOutputFormat 枚举:新增 Excel=1, Csv=2, Txt=3(显式序号,向后兼容);新增多格式相关配置加载。
2026-07-01 11:31:41 +08:00

117 lines
6.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!-- ============================================================ -->
<!-- 报告引擎配置 | Report Engine Configuration -->
<!-- 前缀: Report -->
<!-- ============================================================ -->
<!-- 报告输出文件夹路径(绝对路径)| Report output directory (absolute path) -->
<!-- 默认值: {我的文档}\XplorePlane\Reports | Default: {MyDocuments}\XplorePlane\Reports -->
<add key="Report:OutputDirectory" value="D:\Reports\XplorePlane" />
<!-- 报告模板文件路径(相对于应用程序目录或绝对路径)| Template file path (relative to app dir or absolute) -->
<!-- 默认值: Templates\StandardReportTemplate.json -->
<add key="Report:TemplatePath" value="Templates\StandardReportTemplate.json" />
<!--
输出文件名模式 | File name pattern
支持以下占位符 | Supported placeholders:
{ReportId} - 报告编号(如 RPT-20250512-001| Report ID (e.g. RPT-20250512-001)
{CncProgram} - CNC 程序名称 | CNC program name
{ProductName} - 产品名称 | Product name
{ProductCode} - 产品类型码 | Product type code
{WorkpieceSN} - 工件 SN 码 | Workpiece serial number
{DeviceId} - 检测设备编号(本机)| Inspection device ID (local machine)
{MachineId} - 生产机台号 | Production machine ID
{Date} - 日期(yyyyMMdd| Date (yyyyMMdd)
{Time} - 时间(HHmmss| Time (HHmmss)
{Result} - 综合检测结论(Pass/Fail| Overall inspection result (Pass/Fail)
示例 | Examples:
"{ReportId}" → RPT-20250512-001.pdf
"{Date}_{ProductName}_{WorkpieceSN}" → 20250512_PCB-A01_SN20250001.pdf
"{ProductCode}_{WorkpieceSN}_{Result}" → PCBA-X100_SN20250001_Pass.pdf
"{MachineId}_{CncProgram}_{Date}_{Time}" → MC01_Prog001_20250512_143025.pdf
"{DeviceId}_{Date}_{ReportId}" → XP-CT-001_20250512_RPT-20250512-001.pdf
-->
<add key="Report:FileNamePattern" value="{Date}_{ProductName}_{WorkpieceSN}_{ReportId}" />
<!--
文件名重复时是否自动累加序号 | Auto-increment suffix when file name duplicates
true: 重复时生成 filename(1).pdf, filename(2).pdf ... 不覆盖已有文件
false: 直接覆盖同名文件
-->
<add key="Report:AutoIncrementOnDuplicate" value="true" />
<!-- 生成后是否自动打开 PDF 阅读器 | Auto-open PDF viewer after generation (true/false) -->
<add key="Report:AutoOpenAfterGenerate" value="false" />
<!-- ============================================================ -->
<!-- 多格式输出配置 | Multi-Format Output Configuration -->
<!-- ============================================================ -->
<!--
TXT/CSV 文本编码 | Text encoding for TXT/CSV output
取值 | Valid values
Utf8Bom — UTF-8 with BOM(默认,便于 Excel 识别中文)| UTF-8 with BOM (default, helps Excel recognize Chinese)
Utf8 — UTF-8 without BOM | UTF-8 without BOM
GB2312 — GB2312 编码 | GB2312 encoding
GBK — GBK 编码 | GBK encoding
注意:此配置仅对 TXT/CSV 生效,Excel (.xlsx) 为 OOXML 二进制格式,编码由内部 UTF-8 处理,不受此项影响。
Note: Only applies to TXT/CSV. Excel (.xlsx) is binary OOXML; its encoding is handled internally as UTF-8 and is unaffected.
-->
<add key="Report:TextEncoding" value="Utf8Bom" />
<!--
默认 Excel 模板文件路径(可选)| Default Excel template file path (optional)
配置且指向有效 .xlsx 文件时,Excel 生成器以该模板为基础、按占位符 {{名称}} 填充数据和图像;
为空或未配置时,Excel 生成器走默认结构化生成(无需模板)。
When configured and pointing to a valid .xlsx, the Excel generator fills the template
by placeholder {{name}}; when empty or unconfigured, it uses default structured generation.
支持相对路径(基于应用程序目录)或绝对路径 | Supports relative (based on app dir) or absolute path
示例 | Example: "Templates\InspectionTemplate.xlsx"
-->
<add key="Report:DefaultExcelTemplatePath" value="" />
<!-- ============================================================ -->
<!-- 页面布局配置 | Page Layout Configuration -->
<!-- ============================================================ -->
<!-- 默认页面尺寸 | Default page size (A4) -->
<add key="Report:DefaultPageSize" value="A4" />
<!-- 默认页面方向 | Default orientation (Portrait / Landscape) -->
<add key="Report:DefaultOrientation" value="Portrait" />
<!-- 页面边距(mm),有效范围 0-100 | Page margins (mm), valid range 0-100 -->
<add key="Report:MarginTop" value="20" />
<add key="Report:MarginBottom" value="20" />
<add key="Report:MarginLeft" value="20" />
<add key="Report:MarginRight" value="20" />
<!-- ============================================================ -->
<!-- 公司信息配置 | Company Information Configuration -->
<!-- ============================================================ -->
<!-- 报告中显示的公司名称 | Company name displayed in report -->
<add key="Report:CompanyName" value="海克斯康制造智能技术(青岛)有限公司" />
<!-- 公司 Logo 图片路径(可选,为空则不显示)| Company logo path (optional, empty = no logo) -->
<!-- 支持相对路径(基于应用程序目录)或绝对路径 | Supports relative (based on app dir) or absolute path -->
<add key="Report:CompanyLogo" value="Resources\company_logo.png" />
<!-- ============================================================ -->
<!-- 软件信息配置 | Software Information Configuration -->
<!-- ============================================================ -->
<!-- 报告中显示的软件名称 | Software name displayed in report -->
<add key="Report:SoftwareName" value="XplorePlane" />
<!-- 软件 Logo 图片路径(可选,为空则不显示)| Software logo path (optional, empty = no logo) -->
<!-- 支持相对路径(基于应用程序目录)或绝对路径 | Supports relative (based on app dir) or absolute path -->
<add key="Report:SoftwareLogo" value="Resources\software_logo.png" />
</appSettings>
</configuration>