Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Writing xlsx files looses numberFormat info #81

Open
Freymaurer opened this issue Mar 6, 2023 · 1 comment
Open

[BUG] Writing xlsx files looses numberFormat info #81

Freymaurer opened this issue Mar 6, 2023 · 1 comment
Labels
Type: Feature Request This item is confirmed by the maintainers to be a request for a new feature

Comments

@Freymaurer
Copy link
Collaborator

Describe the bug
I am working on a function to write swate tables from a extern data type. The function looks like this:

/// tables is the external datatype parsed to `Assay`
let assay =  Export.parseBuildingBlockSeqsToAssay tables
let a = QueryModel.QAssay.fromAssay assay
let wb = 
    workbook {
        for (i,s) in List.indexed a.Sheets do QSheet.toSheet i s
        sheet "Assay" {
            for r in MetaData.toDSLSheet assay [] do r
        }
    }
/// Parsing unit is not done correctly.
let fsSpreadsheet = wb.Value.Parse().ToBytes()

Most code is taken from here https://github.com/nfdi4plants/ISADotNet/blob/a06af930e4d3f9d3c49a7b07bb0496f927c4e6cc/src/ISADotNet.XLSX/AssayFile/Assay.fs#L188

If i try to write Swate unit columns, the final .xlsx file does not contain any numberFormat information. All cells have DataType string, even though it should be something like this "0.00 \"unit\"".

Image shows Cell.DataType and Cell.Value
image

If i convert my assay to json with the following code, all unit information is still there, so i assume the information is lost somwhere in ISADotNet to SpreadsheetFs

/// tables is the external datatype parsed to `Assay`
let assay =  Export.parseBuildingBlockSeqsToAssay tables
let parsedJsonStr = ISADotNet.Json.Assay.toString assay
// no unit information lost.
@Freymaurer Freymaurer added the Type: Bug Something is not working, and it is confirmed by maintainers to be a bug. label Mar 6, 2023
@Freymaurer Freymaurer reopened this Sep 25, 2023
@HLWeil HLWeil changed the title [BUG] IsaDotNet writing xlsx files looses numberFormat info [BUG] Writing xlsx files looses numberFormat info Oct 11, 2023
@HLWeil
Copy link
Member

HLWeil commented Oct 11, 2023

Dependent on fslaborg/FsSpreadsheet#21

@Freymaurer Freymaurer moved this to In discussion in ARCStack Jun 6, 2024
@Freymaurer Freymaurer added Type: Feature Request This item is confirmed by the maintainers to be a request for a new feature and removed Type: Bug Something is not working, and it is confirmed by maintainers to be a bug. labels Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request This item is confirmed by the maintainers to be a request for a new feature
Projects
Status: In discussion
Development

No branches or pull requests

2 participants