Style

Style is instance object per excel created to maintain for performance of the document creation process. This istance provides a common handle to set a style combination once refer it across the spreadsheet.

It is highly recomended to use this stratgy and reduce the number of cycle the openXMLOffice.Excel cell row insert life take to find the style id for the repeated setting you are makking using the cell style property. Use the styleId thats given as response from this object to optimise the document creation process.

Sample Code

// To Get the style Id
uint styleId = excel.GetStyleId(new CellStyleSetting()
	{
		isBold = true,
		borderLeft = new()
		{
			style = BorderSetting.StyleValues.THICK
		},
		backgroundColor = "112233"
	});
// Use the Style Id
worksheet.SetRow("A1", new DataCell[6]{
	new(){
		cellValue = "test1",
		dataType = CellDataType.STRING,
		styleId = styleId
	}, new RowProperties());

CellStyleSetting Options

BorderSetting Options

Last updated