We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ArgumentOutOfRangeException while using XlsIO with Excel template

Hi, I am having some problems while exporting data to excel. I think I have problems in excel template. So first of all I want to know how can I create template for excel, so I can place values there. I want to do similar thing which is in sample app. I tried to replicate that excel template but it didn't work and threw exception. Exception details are given below.

Exception :
System.ArgumentOutOfRangeException was unhandled by user code
  HResult=-2146233086
  Message=Can't find property
Parameter name: strText
  Source=Syncfusion.XlsIO.WinRT
  ParamName=strText
  StackTrace:
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.GetNextValue(Object value, String& strText, String& newNumberFormat, 

Type& newType)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetSimpleValue(Object value, String strText, IWorksheet sheet, 

IMigrantRange migrantRange, IList`1 arrMarkerCells, IList lstArguments, MarkerOptionsImpl options, RangeBuilder builder, UnknownVariableAction 

action, String numberFormat, Type valueType)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetArrayValue(IList value, String strText, IWorksheet sheet, 

IMigrantRange migrantRange, IList`1 arrMarkerCells, IList lstArguments, MarkerOptionsImpl options, RangeBuilder builder, UnknownVariableAction 

action, VariableTypeAction variableTypeAction)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetUnknownVariable(Object value, String strText, IWorksheet sheet, 

IMigrantRange migrantRange, IList`1 arrMarkerCells, IList lstArguments, MarkerOptionsImpl options, RangeBuilder builder, UnknownVariableAction 

action, VariableTypeAction variableTypeAction)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.SetVariable(String strVariable, String strText, IWorksheet sheet, 

IMigrantRange migrantRange, IList`1 arrMarkerCells, IList lstArguments, MarkerOptionsImpl options, RangeBuilder builder, UnknownVariableAction 

action)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarker(IWorksheet sheet, IList`1 arrCells, Int32 i, IMigrantRange 

migrantRange, UnknownVariableAction action)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorksheet sheet, List`1 arrLabels, UnknownVariableAction 

action)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(IWorkbook book, UnknownVariableAction action)
       at Syncfusion.XlsIO.Implementation.TemplateMarkers.TemplateMarkersImpl.ApplyMarkers(UnknownVariableAction action)
       at InvoiceExportDemo.ExportToExcel.<GenerateReport>d__0.MoveNext() in d:\Projects\InvoiceExportDemo\InvoiceExportDemo\HelperClass

\ExportToExcel.cs:line 29

line : marker.ApplyMarkers(UnknownVariableAction.Skip);

3 Replies

MM Manikandan M Syncfusion Team July 12, 2013 03:48 AM UTC

Hi Farhan,

 

Thanks for using Syncfusion products.

 

We are able to reproduce the reported issue “Exception is thrown when applying the template marker” from the given details alone. So could be please update us input file which contains template marker variable and also your scenario to reproduce the issue from our side. So that we could update the solution ASAP. So for the inconvenience caused.

 

Please let us know if you need any clarifications.

 

Thanks,

Manikandan M.



FA Farhan July 15, 2013 06:09 AM UTC

I am attaching the project. Now I am not getting exception, I don't know why but my exported excel file is not getting all the values from code. So I think there's problem with my excel template. Can you please see that ? Compare the output file with the template you will get to know the significant difference.




InvoiceExportDemo_6dd45078.zip


MM Manikandan M Syncfusion Team July 18, 2013 04:18 AM UTC

Hi Farhan,

 

Thanks for your detailed update.

 

On analysis, we found that reported issue is not reproducing in our newer version of Essential studio. So we highly recommend you to upgrade your product to newer version. Please let us know If this helps you.

 

Download link for latest version:

http://www.syncfusion.com/downloads/latest-version

Please let us know if you need any clarifications.

 

Thanks,

Manikandan M.

 


Loader.
Up arrow icon