[英]Is there Any way to change the colour of an Excel Cell using C#?
I am working on an ASP project where I need to Change the color of the cells based on some validation Checks and return it to user. 我正在开发一个ASP项目,我需要根据一些验证检查更改单元格的颜色并将其返回给用户。
Currently I have successfully Implemented this functionality using Excel 12.0 Object Library. 目前,我已使用Excel 12.0对象库成功实现了此功能。 But the problem is that I need to improve performance.
但问题是我需要提高性能。 InterOp library is very slower than what I expected.
InterOp库比我预期的要慢。
Is there any way that I can Format the cells on an Excel sheet without using InterOp library. 有没有办法可以在不使用InterOp库的情况下在Excel工作表上格式化单元格。 (Something like connecting using OleDb connection and formatting) ??
(像使用OleDb连接和格式化连接的东西)?
Please Share Your Knowledge 请分享您的知识
Try using ExcelPlusPlus library from codeplex. 尝试使用codeplex中的ExcelPlusPlus库。 It is not using OleDB
它没有使用OleDB
From codeplex: 来自codeplex:
Create advanced Excel 2007/2010 spreadsheets on the server
EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).
EPPlus supports:
Cell Ranges
Cell styling (Border, Color, Fill, Font, Number, Alignments)
Charts
Pictures
Shapes
Comments
Tables
Protection
Encryption
Pivot tables
Data validation
Conditional formatting
VBA
Many more...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.