Posted 30 October 2017, 1:46 am EST
Hi,
I’m getting an exception when I try Workbook.open(…).
I pasted the exception that I’m getting with the stack trace and I attached the excel file that I’m using as example.
Just to clarify I’m converting the file to json and then to .xlsx because I’m simulating my internal process.
Thanks in advance.
Diego.
Exception: Requested value ‘left’ was not found.
StackTrace: at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument)
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at ᤑ.ᜀ(XmlReader A_0)
at ᤑ.ᜆ(XmlReader A_0)
at ᤑ.ᜇ(XmlReader A_0)
at ᤑ.ᜀ(ᤌ A_0, ᩁ A_1, ᤋ A_2)
at ᤛ.ᜀ(ᤌ A_0, ᩁ A_1, ᨺ A_2, ᤋ A_3, Dictionary
2 A_4, List
1 A_5)at ᤛ.ᜀ(ᤌ A_0, ᩁ A_1, ᨺ A_2, Dictionary
2 A_3, ᤋ A_4, Dictionary
2 A_5)at ᤚ.ᜀ(ᤋ A_0, ᨺ A_1, IList
1 A_2, Dictionary
2 A_3)at ᤚ.ᜀ(ᤋ A_0, ᨺ A_1)
at ᤎ.ᜀ(ᨺ A_0, Stream A_1)
at GrapeCity.Documents.Spread.Workbook.Open(Stream fileStream, String password)
at Sheets.Controllers.SPServiceController.AddNameSpService(String fileName) in C:\BNA\Test\Sheets\Sheets\Controllers\SPServiceController.cs:line 44
var json = GetJsonByFileName(fileName);
using (var mems = new MemoryStream())
{
var expo = new Exporter(json);
expo.SaveExcel(mems, ExcelFileFormat.XLSX, ExcelSaveFlags.NoFlagsSet);
var workbook = new Workbook();
workbook.Open(mems);
}
}
private string GetJsonByFileName(string fileName)
{
try
{
var filePath = Path.Combine(Server.MapPath("~/App_Data"), fileName);
using (var fileStream = System.IO.File.Open(filePath, FileMode.Open))
{
var result = new Importer()
.ImportExcel(fileStream);
return result;
}
}
catch (Exception e)
{
return null;
}
}
```[zip filename="Test-Apportionment.zip"]public\uploads\411e5410f20fe037dab57e54d78de1201509374552730.zip[/zip]