misterspeedy / FsExcel

An F# Excel spreadsheet generator
MIT License
142 stars 18 forks source link

Duplicate table headers and data #50

Open gmblpnw opened 1 year ago

gmblpnw commented 1 year ago

I'm trying to run the first example in the tables tutorial (https://github.com/misterspeedy/FsExcel/blob/main/ExcelTableTutorial.md)

When I look at the output I get one table but where the headers and data are duplicated. The first set of headers are appended with the '@' character.

I'm using FsExcel package version 0.0.46

duplicate-table-headers

misterspeedy commented 1 year ago

Thanks for reporting this @gmblpnw. I'll see if I can reproduce it. Please could you also upload the .xlsx this generated?

gmblpnw commented 1 year ago

Thanks for having look at this! ExcelTableSimple.xlsx

misterspeedy commented 1 year ago

Ok, I see the same issue when I open your uploaded sample, thank you. Still investigating.

misterspeedy commented 1 year ago

I ran the example locally, the problem did not reproduce. Very strange.

Can I ask you @gmblpnw - what version of ClosedXml did the notebook load, e.g.

Installed Packages
    ClosedXML, 0.101.0
    FsExcel, 0.0.46

Also what OS are you running?

Many thanks.

gmblpnw commented 1 year ago

Packages: image

The OS I'm running is: Windows 11 Home (10.0.22621 Build 22621)

gmblpnw commented 1 year ago

So oddly enough when I run the script with FSI (Visual Studio 2022 Community Edition, Version 17.6.2) I get the table header/data duplication.

However when I compile the program and run it as a console application it behaves as expected.

gmblpnw commented 1 year ago

The F# Interactive version that I'm using is...

image

misterspeedy commented 1 year ago

Curiouser and curiouser. Thank you!

gmblpnw commented 1 year ago

Looks like I'm also getting the same behavior using F# Interactive from the command line under WSL2 / Ubuntu 22.04.1 where the FSI version is 12.4.0.0 for F# 7.0

gmblpnw commented 1 year ago

I just tried using F# Interactive again on WSL2/Ubuntu 22.04.1 This time I downgraded dotnet from 7.0 to 6.0 where the FSI version is 12.0.0.0 and FSharp.Core was 6.0.1

This time the result was as expected! No duplication of headers / data

misterspeedy commented 1 year ago

Nice work! Do you think this might be a dotnet 7 bug? Tomorrow I might try repro-ing from C# in https://dotnetfiddle.net to eliminate the FsExcel/F# Core aspect altogether.

gmblpnw commented 1 year ago

I guess I'm wondering if the bug is somewhere in F# interactive. The code runs fine under dotnet 7 when compiled into a console app. It's only when the code is run directly in F# interactive that the problem crops up.