You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since F# London, I've been giving FsExcel a bit of thought and came to the conclusion that it might be nicer to work with if it supported using a list of lists.
Thus:
Render.AsFile': path: string -> items: Item list list -> unit
To be consistent with the current API, an Item list would be a row of cells, and an Item list list would be the grid of cells (collection of rows).
For this example, I'm going to make another proposal for EmptyCell as a type of Item, by Go should still work in this system, it's probably need to be separated into distinct GoRow and GoCol. Go (RC(_, _)) wouldn't easily translate:
[[for i in1..6doif i =3then Cell [ String "Col 3"]else EmptyCell
][][][for i in1..6doif i =4then Cell [ String "Row 4"]else EmptyCell
][][for i in1..6doif i =5then Cell [ String "R6C5"]elif i =6then Cell [ String "R6C6"]else EmptyCell
]]|> Render.AsFile' (Path.Combine(savePath,"AbsolutePositioning.xlsx"))
For better type safety, AsFile' could be Render.AsFile': path: string -> items: Item [,] -> unit, but Array2D is definitely not as nice to work with compared to list comprehension.
This is pretty big change, so thought best to create an issue first. I would be happy to create a PR for this, just for the sake of playing around with the library more than anything.
The text was updated successfully, but these errors were encountered:
Honestly, I feel I've created a bit of a monster here so perhaps we should move away from having the tutorial generate the regression tests. Anyway, for now 'it is what it is'.
Hope you are able to try out that list-of-lists feature, it feels like it could be a big improvement.
Since F# London, I've been giving FsExcel a bit of thought and came to the conclusion that it might be nicer to work with if it supported using a list of lists.
Thus:
To be consistent with the current API, an
Item list
would be a row of cells, and anItem list list
would be the grid of cells (collection of rows).So taking examples from the README:
Multiple Cells
Vertical Movement
Absolute Positioning
For this example, I'm going to make another proposal for
EmptyCell
as a type ofItem
, byGo
should still work in this system, it's probably need to be separated into distinctGoRow
andGoCol
.Go (RC(_, _))
wouldn't easily translate:For better type safety,
AsFile'
could beRender.AsFile': path: string -> items: Item [,] -> unit
, butArray2D
is definitely not as nice to work with compared to list comprehension.This is pretty big change, so thought best to create an issue first. I would be happy to create a PR for this, just for the sake of playing around with the library more than anything.
The text was updated successfully, but these errors were encountered: