question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Moving FsExcel to a gdiplus-free ClosedXML alternative

See original GitHub issue

With .NET 7 which is openly gonna drop System.Drawing.Common stuff for non-Windows platforms, I’m wondering if FsExcel should change the ClosedXML implementation on which it relies on to something that doesn’t need System.Drawing.Common like that one?

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
misterspeedycommented, Feb 27, 2023

Ah, interesting! I’ll see if I can find a way round that. Thank you!

On Mon, 27 Feb 2023 at 17:37, Adelar da Silva Queiróz < @.***> wrote:

Thank you! Actually @emigajda https://github.com/emigajda already upgraded to the latest ClosedXml as part of their work on merged cells, released in 0.0.39. So if you did have a moment to check we are now where we hoped to be that would be wonderful - thanks!

Cool! I just did a test here and shows a exception about missing font. Now will be necessary to inform font names?

  An unhandled exception has occurred while executing the request.
  System.ArgumentException: Unable to find font Calibri or fallback font Microsoft Sans Serif. Install missing fonts or specify a different fallback font through 'LoadOptions.DefaultGraphicEngine = new DefaultGraphicEngine("Fallback font name")'. Additional information is available at https://closedxml.readthedocs.io/en/latest/tips/missing-font.html page.
     at ClosedXML.Graphics.DefaultGraphicEngine.LoadFont(MetricId metricId)
     at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
     at ClosedXML.Graphics.DefaultGraphicEngine.GetFont(MetricId metricId)
     at ClosedXML.Graphics.DefaultGraphicEngine.GetFont(IXLFontBase fontBase)
     at ClosedXML.Graphics.DefaultGraphicEngine.GetTextWidth(String text, IXLFontBase fontBase, Double dpiX)
     at ClosedXML.Excel.XLColumn.GetWidthInCharacters(String text, IXLFontBase font)
     at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow, Int32 endRow, Double minWidth, Double maxWidth)
     at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow, Int32 endRow)
     at ClosedXML.Excel.XLColumn.AdjustToContents(Int32 startRow)
     at ClosedXML.Excel.XLColumn.AdjustToContents()
     at ClosedXML.Excel.XLColumns.<>c.<AdjustToContents>b__13_0(XLColumn c)
     at ClosedXML.Excel.EnumerableExtensions.ForEach[T](IEnumerable`1 source, Action`1 action)
     at ClosedXML.Excel.XLColumns.AdjustToContents()
     at FsExcel.Render.AsWorkBook(FSharpList`1 items)
     at FsExcel.Render.AsFile(String path, FSharpList`1 items)
     at server.Planilha.gerarPlanilha(DateTime dataInicial, DateTime dataFinal, FSharpList`1 list) in /app/lib/Planilha.fs:line 125
     at server.Rules.gerarPlanilha(DateTime dataInicial, DateTime dataFinal) in /app/lib/Rules.fs:line 229
     at server.Handlers.RelatorioHandlers.consultar(HttpContext ctx) in /app/lib/Handlers.fs:line 47
     at ***@***.***(HttpContext ctx)
     at Microsoft.AspNetCore.Routing.EndpointMiddleware.Invoke(HttpContext httpContext)
  --- End of stack trace from previous location ---
     at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

— Reply to this email directly, view it on GitHub https://github.com/misterspeedy/FsExcel/issues/34#issuecomment-1446756815, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGDPLWA7LW4VYGCO5KML7LWZTQ37ANCNFSM56L7VBXA . You are receiving this because you were mentioned.Message ID: @.***>

1reaction
misterspeedycommented, Mar 9, 2023

@adelarsq what do you think of the workaround I’ve added in the latest comment in #41 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optimize cell collection data structure · Issue #1969
ClosedXML has massive memory consumption. This issue contains a proposal for change of data structures that contain cells.
Read more >
Remove System.Drawing.Common dependency #1805
Moving FsExcel to a gdiplus-free ClosedXML alternative misterspeedy/FsExcel#34 ... ClosedXML/ClosedXML/branch/develop/artifacts. Documentation is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found