Magicodes.IE icon indicating copy to clipboard operation
Magicodes.IE copied to clipboard

在 excle 使用 Dictionary<string, object> 动态导出时 能否弄个默认值

Open OxOld opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. 在 excel 使用 Dictionary<string, object> 动态导出时 模版文件 列 在数据中 没有 能否弄成默认值 或者 让异常 选择性的抛出。 我这边 是有个动态表单的导出,所以 会导致 上传的模版 和 数据对应不上 就会导致异常。

例如:我的模板里面 有 【WorkUnit】字段,我的数据字典里面 没有 【WorkUnit】字段 就会抛出 【The given key 'WorkUnit' was not present in the dictionary.】 异常。

Describe the solution you'd like 不抛出异常或者选择性的抛出,或者就默认为空白也可以。

Describe alternatives you've considered 之前是直接复制源码 重新修改一下 这个判断,现在版本升级后就不好处理了

OxOld avatar Oct 08 '23 02:10 OxOld