Files
XplorePlane/XP.ReportEngine/Models/ReportRequest.cs
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

58 lines
2.6 KiB
C#

using System.Collections.Generic;
namespace XP.ReportEngine.Models
{
/// <summary>
/// 报告生成请求 | Report generation request
/// 封装外部调用方生成报告所需的全部输入参数
/// Encapsulates all input parameters needed by external callers to generate a report
/// </summary>
public class ReportRequest
{
/// <summary>
/// 处理器输出数据列表 | List of processor output data
/// </summary>
public List<ProcessorOutput> ProcessorOutputs { get; set; } = new();
/// <summary>
/// 报告元数据(产品名、操作员、描述等)| Report metadata (product name, operator, description, etc.)
/// </summary>
public ReportMetadata Metadata { get; set; }
/// <summary>
/// 额外图像数据(如工件整体图、自定义图像)| Additional image data (e.g., workpiece overview, custom images)
/// 键为 dataKey,值为图像数据
/// Key is dataKey, value is image data
/// </summary>
public Dictionary<string, ImageData> AdditionalImages { get; set; } = new();
/// <summary>
/// 输出文件路径(可选)| Output file path (optional)
/// 为空时根据 ReportConfig 和 FileNameParameters 自动生成
/// When empty, auto-generated based on ReportConfig and FileNameParameters
/// </summary>
public string OutputFilePath { get; set; }
/// <summary>
/// 文件名占位符参数(可选)| File name placeholder parameters (optional)
/// 用于 ReportConfig.FileNamePattern 中的占位符替换
/// Used for placeholder replacement in ReportConfig.FileNamePattern
/// </summary>
public Dictionary<string, string> FileNameParameters { get; set; } = new();
/// <summary>
/// 自定义属性(可选)| Custom properties (optional)
/// 额外的键值对数据,会合并到 ReportContext.Properties 中
/// Additional key-value data merged into ReportContext.Properties
/// </summary>
public Dictionary<string, object> CustomProperties { get; set; } = new();
/// <summary>
/// 期望输出格式集合(可选,1-4 种不重复)| Desired output formats (optional, 1-4 distinct)
/// 为 null 或空时,ReportService 默认使用 ReportOutputFormat.Pdf 保持现有行为
/// When null or empty, ReportService defaults to Pdf to preserve existing behavior
/// </summary>
public List<ReportOutputFormat> Formats { get; set; } = new();
}
}