我正在使用 SyncFusion XlsIo 将数据导出到 Excel 表。我在将数据导出到 Excel 时遇到了一些问题。我想我在excel模板中有问题。所以首先我想知道如何为 excel 创建模板,以便我可以在那里放置值?我想在 SyncFusion SDK 提供的示例应用程序中做类似的事情。我试图复制那个 excel 模板,但它没有用并抛出异常。异常详情如下。
异常:System.ArgumentOutOfRangeException 未被用户代码处理 HResult=-2146233086 消息=找不到属性参数名称:strText Source=Syncfusion.XlsIO.WinRT ParamName=strText
StackTrace:在 Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.GetNextValue(对象值,String&strText,String&newNumberFormat,Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetSimpleValue(Object value, String strText, IWorksheet sheet,
IMigrantRange 迁移范围,IList`1 arrMarkerCells,IList lstArguments,MarkerOptionsImpl 选项,RangeBuilder 构建器,UnknownVariableAction
Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetArrayValue(IList value, String strText, IWorksheet sheet,
IMigrantRange 迁移范围,IList`1 arrMarkerCells,IList lstArguments,MarkerOptionsImpl 选项,RangeBuilder 构建器,UnknownVariableAction
Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetUnknownVariable(Object value, String strText, IWorksheet sheet, 上的操作、VariableTypeAction variableTypeAction)
IMigrantRange 迁移范围,IList`1 arrMarkerCells,IList lstArguments,MarkerOptionsImpl 选项,RangeBuilder 构建器,UnknownVariableAction
Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetVariable(String strVariable, String strText, IWorksheet sheet, 上的操作、VariableTypeAction variableTypeAction)
IMigrantRange 迁移范围,IList`1 arrMarkerCells,IList lstArguments,MarkerOptionsImpl 选项,RangeBuilder 构建器,UnknownVariableAction
操作)在 Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarker(IWorksheet 表,IList`1 arrCells,Int32 i,IMigrantRange
Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorksheet 工作表,List`1 arrLabels,UnknownVariableAction 的迁移范围,UnknownVariableAction 操作)
action) 在 Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorkbook book, UnknownVariableAction action) at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(UnknownVariableAction action) at InvoiceExportDemo.ExportToExcel.d__0.MoveNext() in d: \Projects\InvoiceExportDemo\InvoiceExportDemo\HelperClass
\ExportToExcel.cs:第 29 行
线 :marker.ApplyMarkers(UnknownVariableAction.Skip);