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
openSystem.DataopenFsExcelopenClosedXML.Excellettable=new DataTable("Fruits")letid=new DataColumn()
id.ColumnName <-"Id"
table.Columns.Add(id)letname=new DataColumn()
name.ColumnName <-"Name"
table.Columns.Add(name)letaverageWeightG=new DataColumn()
averageWeightG.ColumnName <-"AverageWeightG"
table.Columns.Add(averageWeightG)for id, name, averageWeightG in[1,"Apple",100;2,"Pear",110;3,"Banana",120]doletrow= table.NewRow()
row["Id"]<- id
row["Name"]<- name
row["AverageWeightG"]<- averageWeightG
table.Rows.Add(row)letcellStyleHorizontal index name =if index =0then[
Border(Border.Bottom XLBorderStyleValues.Medium)
FontEmphasis Bold
]elif name ="Fees"then[ FormatCode "$0.00"]else[]seq{for row in table.Rows -> row}|> Table.fromSeq Table.Direction.Horizontal cellStyleHorizontal
|>fun cells -> cells @[ AutoFit All ]|> Render.AsFile (Path.Combine(savePath,"RecordSequenceVertical.xlsx"))
Error: System.ArgumentException: Type 'System.Data.DataRow' is not an F# record type. (Parameter 'recordType')
at Microsoft.FSharp.Reflection.Impl.checkRecordType(String argName, Type recordType, BindingFlags bindingFlags) in D:\a_work\1\s\src\fsharp\FSharp.Core\reflect.fs:line 849
at FsExcel.Table.Fields.serializable@16.Invoke(Type _arg1)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at FsExcel.Table.Fields.serializable(Type t)
at FsExcel.Table.Cells.header[T](FSharpFunc2 getCellStyle) at FsExcel.Table.fromSeq[T](Direction direction, FSharpFunc2 getCellStyle, IEnumerable`1 xs)
at <StartupCode$FSI_0025>.$FSI_0025.main@()
The text was updated successfully, but these errors were encountered:
For example, this causes an error:
Error: System.ArgumentException: Type 'System.Data.DataRow' is not an F# record type. (Parameter 'recordType')
at Microsoft.FSharp.Reflection.Impl.checkRecordType(String argName, Type recordType, BindingFlags bindingFlags) in D:\a_work\1\s\src\fsharp\FSharp.Core\reflect.fs:line 849
at FsExcel.Table.Fields.serializable@16.Invoke(Type _arg1)
at System.Collections.Concurrent.ConcurrentDictionary
2.GetOrAdd(TKey key, Func
2 valueFactory)at FsExcel.Table.Fields.serializable(Type t)
at FsExcel.Table.Cells.header[T](FSharpFunc
2 getCellStyle) at FsExcel.Table.fromSeq[T](Direction direction, FSharpFunc
2 getCellStyle, IEnumerable`1 xs)at <StartupCode$FSI_0025>.$FSI_0025.main@()
The text was updated successfully, but these errors were encountered: