The Value property of DefinedName (implementing ISpreadsheetName) always returns a result with a General format, which is very impractical when the value is for example a date. There should be an option to get a formatted result as well.
A possible workaround for this missing functionality would be to parse the RefersTo value and find where it points in order to grab the format:
Workbook workbook = new Workbook();
Worksheet ws = workbook.Worksheets.Add();
ws.Cells[0, 1].SetValue("2/1/2013");
ws.Names.Add("MyField", "=Sheet1!$B$1", new CellIndex(0, 0), "My Field");
string value = ws.Names["MyField"].Value;
CellRange range;
bool success = NameConverter.TryConvertCellRangeNameToCellRange(ws.Names["MyField"].RefersTo, out range);
CellValueFormat format = ws.Cells[range].GetFormat().Value;
string result = ws.Cells[range].GetValue().Value.GetResultValueAsString(format);
When a worksheet contains a cell with longer text, which is right aligned and this text happens to be in the last column of the page, the worksheet is incorrectly split into pages and the last column gets transferred on the next page.
Workaround: Set explicitly the print area you would like to print.
worksheet.WorksheetPageSetup.PrintArea.SetPrintArea(new CellRange(0, 0, 38, 14));
LayoutHelper is not calculating Height properly in net standard.
Workaround: use SpreadFixedTextMeasurer
Provide the following options for the image:
When a worksheet has a function of the type "=Indirect("A1")" and the value in A1 is edited, the result of the function is not updated. This, however, happens only after the file is imported. If the function is created through code or SetValueAsFormula is called after import, the function works as expected.
Workaround:
CellRange usedCellRange = worksheet.UsedCellRange;
for (int row = 0; row < usedCellRange.RowCount; row++)
{
for (int column = 0; column < usedCellRange.ColumnCount; column++)
{
ICellValue cellValue = worksheet.Cells[row, column].GetValue().Value;
if (cellValue.ValueType == CellValueType.Formula)
{
worksheet.Cells[row, column].SetValue(cellValue);
}
}
}