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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error trying to create pivot table

Thread ID:





120557 Sep 25,2015 03:45 AM UTC Sep 25,2015 08:40 AM UTC WinForms 1
Tags: XlsIO
Timothy L Anderson
Asked On September 25, 2015 03:45 AM UTC

I am running on an older version of xlsio and i am trying to create a pivot table.

I use the following code:
IWorksheet main = wkb.Worksheets[0];

IWorksheet wks = wkb.Worksheets.Create(account.AccountName);

string range = String.Format("A{0}:G{1}", (account.header_row - 1), (account.stop_row - 1));
IPivotCache cache = wkb.PivotCaches.Add(main.Range[range]);

I am getting the following exception:

System.ArgumentException: strName - string cannot be empty
   at Syncfusion.XlsIO.Implementation.Collections.PivotCacheFieldsCollection.AddNewField(String strName)
   at Syncfusion.XlsIO.Implementation.PivotTables.PivotCacheImpl..ctor(IApplication application, Object parent, IRange dataRange)
   at Syncfusion.XlsIO.Implementation.PivotTables.PivotCacheCollection.Add(IRange range)
   at HoldingsIndustryReport.Program.generate_accounts_worksheets(IWorkbook& wkb, List`1 accounts) in Program.cs:line 158
   at HoldingsIndustryReport.Program.Main(String[] args) in Program.cs:line 469

I found reference to this error here:


But there is no information about the error, other than it is a existing issue.

Mathu Mohan Vijayakumar [Syncfusion]
Replied On September 25, 2015 08:40 AM UTC

Hi Timothy,

It seems to be a usage level issue. In your code we can see that you are selecting the range with empty cells to add the pivot cache. Hence the exception is thrown. You can resolve this by adding values to the range before performing this. Kindly refer to the online documentation related to pivot tables from the following link.
UG Documentation Link:

You have mentioned that your file version is We strongly recommend you to upgrade to our latest version (, which has more features and enhancements. This is available for download under the following link.

Latest Version:

Mathu Mohan V A


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon