Skip to content

Commit

Permalink
Merge pull request #32 from CSBiology/bug-noRowsFromFile-#31
Browse files Browse the repository at this point in the history
#31 No FsRows when read from file
  • Loading branch information
omaus authored Jul 17, 2023
2 parents a0c11d0 + 0dfd1f0 commit 1b8d874
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/FsSpreadsheet.ExcelIO/FsExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ module FsExtensions =
)

sheets
|> Seq.fold (fun wb sheet -> FsWorkbook.addWorksheet sheet wb) (new FsWorkbook())
|> Seq.fold (
fun wb sheet ->
sheet.RescanRows() // we need this to have all FsRows present in the final FsWorksheet
FsWorkbook.addWorksheet sheet wb
) (new FsWorkbook())

/// <summary>
/// Creates an FsWorkbook from a given Stream to an XlsxFile.
Expand Down
3 changes: 3 additions & 0 deletions tests/FsSpreadsheet.ExcelIO.Tests/FsExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ let fsExtensionTests =
testCase "Worksheet SwateTemplateMetadata from 2EXT02_Protein has correct value" <| fun _ ->
let v = tf2Worksheet.Value.CellCollection.TryGetCell(1,1).Value.Value
Expect.equal v "Id" "value is not equal"
testCase "Worksheet SwateTemplateMetadata from 2EXT02_Protein has FsRows" <| fun _ ->
let rows = tf2Worksheet.Value.Rows
Expect.isGreaterThan rows.Length 0 "Worksheet SwateTemplateMetadata from 2EXT02_Protein has no FsRows"
]
]
]

0 comments on commit 1b8d874

Please sign in to comment.