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

File with existing pivot edited with XlsIO works on develop machine, corrupt pivot on production machine

I'm using version 11.4400.0.26.

I have created (through excel) an xlsx file with tabular data on sheet 1, a pivot table on sheet 3 (based on sheet 1), a graph on sheet 2 (based on sheet 3). The file contains a minimal sample data to allow me to customize the pivot and the graph.

Then i open the xlsx with yout library XlsIO, replace and append fresh data on sheet 1 (keeping the column names and not touching at all sheet 2 and 3) and download the resulting xlsx file.

When i open it the pivot is updated with the new data, and the graph too.

On develop machine this works perfectly; once published on production machine when i open the resulting xlsx file excel tells me that the file is corrupted, removing the pivotCacheDefinition and pivotTable and ... crushing pivot and graph.

If on production i use a model without pivot everything works so the Syncfusion libraries seem to work correctly, the problem arise only when it contains pivot, and only on production machine. I also found that the working version is smaller (218k) than the corrupted one (266k).

I double checked (and overwrited too) the syncfusion dlls to ensure that the version is the same on both machines.

I'm stuck and don't know where to look.

I attach a zip containing:

- Model0011.xlsx the starting file with sample data

- result on develop machine.xlsx the working one

result on production machine.xlsx the corrupted one

Please help,


Attachment: sample_e414eaff.zip

4 Replies

FC Fabrizio Cioni February 13, 2015 11:37 AM UTC

I wrote a new request Excel file with Pivot corrupted if opened with XlsIO that details the problem with a simpler description.
Still a blocking problem.

PK Prakash Kumar D Syncfusion Team February 13, 2015 01:22 PM UTC

Hi Fabrizio ,


Thank you for using Syncfusion product.


The reported issue is reproduced due to the culture. We are analyzing on this with the provide XlsIO generated files. However it would better if you could share us the sample code snippet which helps us to find the actual cause of the issue and we get back to you with prompt solution.


Please let me know if you have any questions.



Prakash Kumar.

FC Fabrizio Cioni February 13, 2015 01:36 PM UTC

Hi Prakash,
Thanks for your answer.

As you may have seen i repeated the problem in a simpler context here.

To reproduce the problem i 'simply' opened the xlsx with XlsIo and saved with a different name, with no editing.
The code is as follows

            string modelName = HttpContext.Current.Request.PhysicalApplicationPath + "\\UserData\\Models\\Model0011.xlsx";
            ExcelEngine excelEngine = new ExcelEngine();
            IApplication application = excelEngine.Excel;
            IWorkbook workbook = application.Workbooks.Open(modelName);
            IWorksheet sheet = workbook.Worksheets[0];
            workbook.SaveAs(HttpContext.Current.Request.PhysicalApplicationPath + "\\UserData\\Models\\Result" + DateTime.Now.ToString("yyyyMMddHHmmss") + ".xlsx");

I also thougth about a culture related problem and i tried adding before the previous code 
            string language = "it";
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(language);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(language);

No good result.
On web.config i always set <globalization culture="it-IT" uiCulture="it-IT" /> to ensure the culture.
I also tested the server querying
            Thread.CurrentThread.CurrentCulture.Name + "-" + Thread.CurrentThread.CurrentUICulture.Name
And both development and production answer it-IT.

Thanks for your answer (this problem is killing me) and for any details or workaround you can suggest.

DB Dilli Babu Nandha Gopal Syncfusion Team February 16, 2015 01:12 PM UTC

Hi Fabrizio,

Thank you for updating us.

We have analyzed the sample and understood that the time separator of the culture in production machine is dot(.) and causes corrupt in pivot. We are able to reproduce the issue and requesting you to use the below workaround. Also, kindly share us the time format of issue reproducing machine to investigate further on this.

As a workaround, you can set the time format of the current culture to colon(:) and it can be achieved by the following code snippet.

Code Snippets:

     System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.TimeSeparator = ":";

Please let us know if you have any concerns.


Dilli babu.

Live Chat Icon For mobile
Up arrow icon