SpreadProcessing: InvalidOperationException when opening an XLS document with a named range that refers to a formula. The message is "Only applicable to named ranges". Opened correctly in Excel.
Parsing a document that contains a cell with wrapped multiline text and its row doesn't define a value for height, results in wrong row height when rendering or exporting to PDF.
Workaround: Fit the height of the row when it contains wrapped cells:
Worksheet worksheet = workbook.ActiveWorksheet;
CellRange wrappedCells = worksheet.GetUsedCellRange(CellPropertyDefinitions.IsWrappedProperty);
for (int i = wrappedCells.FromIndex.RowIndex; i < wrappedCells.ToIndex.RowIndex; i++)
{
worksheet.Rows[i].AutoFitHeight();
}
Currently, the following text filters are not supported in the model:
Currently, similar conversions should be manually implemented by the users.
Sample method that could be used:
public static Color HexStringToColor(string hexColor)
{
// Remove the # at the front.
if (hexColor.StartsWith("#"))
{
hexColor = hexColor.Substring(1, hexColor.Length - 1);
}
byte a = 255;
byte r = 255;
byte g = 255;
byte b = 255;
int start = 0;
// Handle ARGB strings (8 characters long).
if (hexColor.Length == 8)
{
start = 2;
}
//Handle contracted RGB strings (3 characters long)
if (hexColor.Length == 3)
{
hexColor = string.Format("{0}{0}{1}{1}{2}{2}", hexColor[0], hexColor[1], hexColor[2]);
}
else if (hexColor.Length < 6)
{
hexColor = hexColor.PadLeft(6, '0');
}
// Convert RGB characters to bytes.
r = byte.Parse(hexColor.Substring(start, 2), NumberStyles.HexNumber);
g = byte.Parse(hexColor.Substring(start + 2, 2), NumberStyles.HexNumber);
b = byte.Parse(hexColor.Substring(start + 4, 2), NumberStyles.HexNumber);
return Color.FromArgb(a, r, g, b);
}