dotnetcore / NPOI

A .NET library for reading and writing Microsoft Office binary and OOXML file formats.
Apache License 2.0
1.92k stars 413 forks source link

NPOI version 1.2.2 not working with alpine 2.2 #165

Open leandromoh opened 4 years ago

leandromoh commented 4 years ago

after add in docker file RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories as suggested on README of this repository and receive the bellow exception.

environment .Net core 2.2 Alpine | Self Contained | mcr.microsoft.com/dotnet/core/runtime-deps:2.2-alpine |

 [ArgumentException: Font '?' cannot be found.]
Source: System.Drawing.Common
StackTrace:
at System.Drawing.FontFamily.GetGdipGenericSansSerif()
   at System.Drawing.FontFamily.get_GenericSansSerif()
   at System.Drawing.Font.CreateFont(String familyName, Single emSize, FontStyle style, GraphicsUnit unit, Byte charSet, Boolean isVertical)
   at NPOI.SS.Util.SheetUtil.IFont2Font(IFont font1)
   at NPOI.SS.Util.SheetUtil.getDefaultCharWidth(IWorkbook wb)
   at NPOI.SS.Util.SheetUtil.GetColumnWidth(ISheet sheet, Int32 column, Boolean useMergedCells)
   at NPOI.XSSF.UserModel.XSSFSheet.AutoSizeColumn(Int32 column, Boolean useMergedCells)
   at StoneCo.Treasury.AssetsTrader.Apis.Formatter.ExcelConverterExtensions.ToExcel[T](IEnumerable`1 source, String sheetName, IReadOnlyList`1 header, Action`2 fillRow) in /vsts/agent/_work/5/s/src/StoneCo.Treasury.AssetsTrader.Api/Apis/Formatter/ExcelConverterExtensions.cs:line 31
   at StoneCo.Treasury.AssetsTrader.Apis.Formatter.ExcelOutputFormatter.WriteResponseBodyAsync(OutputFormatterWriteContext context) in /vsts/agent/_work/5/s/src/StoneCo.Treasury.AssetsTrader.Api/Apis/Formatter/ExcelOutputFormatter.cs:line 30
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultAsync(IActionResult result)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResultFilterAsync[TFilter,TFilterAsync]()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResultExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultFilters()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)