Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1.废除FastMode, 支持http响应流直接输出(取消了流回退功能,见解释)
2.每1000行进行重刷一次,节约内存
3不使用new List导致迭代器全部计算浪费内存
4.解释:
在OpenXML中,<x:dimension ref="..."/> 元素指定了工作表中使用的单元格区域,它定义了工作表中所有单元格的最小矩形范围。这个元素是可选的,因为Excel和其他兼容的电子表格程序通常能够在没有这个元素的情况下打开文件,并计算出实际使用的单元格范围。
然而,省略 <x:dimension ref="..."/> 可能会导致性能问题,尤其是在处理大型工作表时。如果存在这个元素,电子表格程序可以直接定位到工作表中的活动区域,而不需要扫描整个工作表来确定哪些单元格包含数据。这可以减少文件打开的时间和内存使用量。
所以,如果你在乎打开文件的性能,特别是对于大型的工作表,最好是包含 <x:dimension ref="..."/> 元素。但如果你在生成的文件中遇到兼容性问题,或者你正在处理的是小型工作表,并且不太关心打开文件的性能,那么你可以选择省略它。
在OpenXML SDK中,如果你使用OpenXmlWriter来写入工作表,你可以选择是否写入这个元素。如果你决定省略它,确保你的电子表格程序能够在没有这个元素的情况下正确处理文件。