theprateik / openexcel Goto Github PK
View Code? Open in Web Editor NEWLibrary to export data to Excel using OpenXML SAX
Library to export data to Excel using OpenXML SAX
Creating styles is slight complex.
When writing multiple excels, and using the same instance of the CellFormat or other style objects causes the second excel writer to throw "Cannot insert the OpenXmlElement "newChild" because it is part of a tree. ".
This works:
public static class CellFormat
{
public static OpenExcelCellFormat C1 => new OpenExcelCellFormat("{8E11D0D2-E7CB-4512-88D3-767CACE014E5}") { Font = Font.F1 };
public static OpenExcelCellFormat C2 => new OpenExcelCellFormat("{B409BC3E-036C-4BF1-8F47-C3EBA3A7DF13}") { Font = Font.F2, Fill = Fill.F1 };
public static OpenExcelCellFormat C3 => new OpenExcelCellFormat("{AC8CFBB3-10EA-44CB-8E02-93D022F1D632}") { NumberingFormat = NumberFormat.N1 };
public static OpenExcelCellFormat C4 => new OpenExcelCellFormat("{862B69A0-C87A-4CED-995E-E030EA1E2358}") { Font = Font.F2, Fill = Fill.F2 };
}
This doesn't work:
public static class CellFormat
{
public static OpenExcelCellFormat C1 = new OpenExcelCellFormat(Guid.NewGuid().ToString()) { Font = Font.F1 };
public static OpenExcelCellFormat C2 = new OpenExcelCellFormat(Guid.NewGuid().ToString()) { Font = Font.F2, Fill = Fill.F1 };
public static OpenExcelCellFormat C3 = new OpenExcelCellFormat(Guid.NewGuid().ToString()) { NumberingFormat = NumberFormat.N1 };
public static OpenExcelCellFormat C4 = new OpenExcelCellFormat(Guid.NewGuid().ToString()) { Font = Font.F2, Fill = Fill.F2 };
}
Implement SharedString
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.