简体   繁体   English

如何将Excel文件转换为文件流并保持计算模式

[英]how to convert excel file to filestream and maintain calculation mode

So I have an excel file. 所以我有一个Excel文件。 I have a number of formula in the file. 文件中有许多公式。 I set the calculation mode of the file to Manual. 我将文件的计算模式设置为“手动”。 I save the file to a db by converting to a filestream. 我通过转换为文件流将文件保存到db。

var fileStream = new FileStream(path, FileMode.Open);
var binaryReader = new BinaryReader(fileStream);
var bytes = binaryReader.ReadyBytes(convert.ToInt32(new FileInfo(path).Length));

However when I convert it to an Excel file using the Syncfusion tool, the Formula Calculation Mode is always set to Automatic which makes me think that this is lost when saving it to the DB. 但是,当我使用Syncfusion工具将其转换为Excel文件时,“公式计算模式”始终设置为“自动”,这使我认为将其保存到数据库时会丢失。

Is there another way of converting to Binary that I could use that would maintain this state of the file? 有没有其他方法可以转换为Binary来保持文件的这种状态?

The issue with ”CalculationMode is not applied proper” has been fixed recently in Syncfusion.XlsIO.Base and the fix will be included in our upcoming release, which will be rolled out in the end of August 2016. 最近在Syncfusion.XlsIO.Base中已解决了“ CalculationMode不适当地应用”问题,该修复程序将包含在我们即将发布的版本中,该版本将于2016年8月推出。

For further questions please contact our support team at support@syncfusion.com to get a prompt assistance on this. 如有其他问题,请通过support@syncfusion.com与我们的支持团队联系,以获取有关此方面的及时帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM