Initial commit of the ClosedXML library
Establishes the foundational structure, core Excel functionality, and tooling. - Implements base components for cells, ranges, columns, and rows. - Integrates a custom calculation engine with a wide range of Excel functions. - Adds comprehensive support for styling, conditional formatting, data validation, comments, pictures, and charts. - Configures build setup, project metadata (NuGet), and developer guidelines. - Includes editor and Git attributes for consistent code style and line endings.
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using ClosedXML.Excel;
|
||||
|
||||
|
||||
namespace ClosedXML_Examples.Misc
|
||||
{
|
||||
public class WorkbookProperties : IXLExample
|
||||
{
|
||||
#region Variables
|
||||
|
||||
// Public
|
||||
|
||||
// Private
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
// Public
|
||||
|
||||
// Private
|
||||
|
||||
// Override
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
|
||||
// Public
|
||||
|
||||
// Private
|
||||
|
||||
// Override
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
// Public
|
||||
public void Create(String filePath)
|
||||
{
|
||||
var wb = new XLWorkbook();
|
||||
var ws = wb.Worksheets.Add("Workbook Properties");
|
||||
|
||||
wb.Properties.Author = "theAuthor";
|
||||
wb.Properties.Title = "theTitle";
|
||||
wb.Properties.Subject = "theSubject";
|
||||
wb.Properties.Category = "theCategory";
|
||||
wb.Properties.Keywords = "theKeywords";
|
||||
wb.Properties.Comments = "theComments";
|
||||
wb.Properties.Status = "theStatus";
|
||||
wb.Properties.LastModifiedBy = "theLastModifiedBy";
|
||||
wb.Properties.Company = "theCompany";
|
||||
wb.Properties.Manager = "theManager";
|
||||
|
||||
// Creating/Using custom properties
|
||||
wb.CustomProperties.Add("theText", "XXX");
|
||||
wb.CustomProperties.Add("theDate", new DateTime(2011, 1, 1, 17, 0, 0, DateTimeKind.Utc)); // Use UTC to make sure test can be run in any time zone
|
||||
wb.CustomProperties.Add("theNumber", 123.456);
|
||||
wb.CustomProperties.Add("theBoolean", true);
|
||||
|
||||
wb.SaveAs(filePath);
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
// Override
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user