Skip to content

datatable类型数据导出excel服务数值型默认是文本方式保存,字段标题重复会报错 #3244

Answered by ArgoZhang
densen2014 asked this question in Q&A
Discussion options

You must be logged in to vote

增加导出配置类

/// <summary>
/// Table 导出 Excel 配置类
/// </summary>
public class TableExportOptions
{
    /// <summary>
    /// 获得/设置 是否使用格式化 默认 true 如果设置 <see cref="TableColumn{TItem, TType}.FormatString"/> 或者 <see cref="TableColumn{TItem, TType}.Formatter"/> 后使用格式化值
    /// </summary>
    /// <remarks>注意格式化后返回值是 <code>string</code> 会导致原始值类型改变</remarks>
    public bool EnableFormat { get; set; } = true;

    /// <summary>
    /// 获得/设置 是否使用 Lookup 默认 true
    /// </summary>
    public bool EnableLookup { get; set; } = true;

    /// <summary>
    /// 获得/设置 是否将数组类型值进行合并操作 默认 true
    /// </summary>
    public bool AutoMergeArray { get; set; } = true;

    /// <summary>
    /// 获得/设置 是否使用枚举类型的 <se…

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

densen2014
Apr 8, 2024
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

densen2014
Apr 9, 2024
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by densen2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants
Converted from issue

This discussion was converted from issue #3243 on April 09, 2024 01:59.