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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Excel file with Pivot corrupted if opened with XlsIO

Thread ID:

Created:

Updated:

Platform:

Replies:

118231 Feb 13,2015 11:35 AM UTC Feb 18,2015 11:12 AM UTC ASP.NET Web Forms 3
loading
Tags: XlsIO
Fabrizio Cioni
Asked On February 13, 2015 11:35 AM UTC

Opening an xlsx containing a pivot with XlsIO on my development machine works as expected.
Opening the same file on production machine the file is corrupted.

What should i look for ?

In the attached zip:
* testmodel0011.xlsx, the original file
* resultOK.xlsx, working, opened on development machine
* resultKO.xlsx, corrupted, opened on production machine

Please help, this is a blocking problem.

Attachment: sample_17da3221.zip

Dilli Babu Nandha Gopal [Syncfusion]
Replied On February 16, 2015 01:25 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.

Regards,

Dilli babu.



Fabrizio Cioni
Replied On February 17, 2015 08:12 PM UTC

Hi Dilli Babu,
thanks for your suggestion, it didn't solve the problem but pointed me to the right direction.
Now i have the solution but (in my humble opinion) is just a workaround to some bug.

Allow me to detail.
I can confirm that the problem is about the dates, creating simples pivot without dates the file is created without corruption.
I also changed the time format setting on the server to ":" but i still had problems.

.Net doesn't allow direct change to TimeFormat but i achieved what  you were suggesting with this

            System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("it");
            ci.DateTimeFormat.TimeSeparator = ":";

            System.Threading.Thread.CurrentThread.CurrentCulture = ci;
            System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

with this setting the file had not error, but now dates were written in it, so i had a different kind of failure.

After many trial i thought that you probably work and use english operative systems, so i tried to recreate the most 'sane' test environment and changed the code to
            System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("en");
            System.Threading.Thread.CurrentThread.CurrentCulture = ci;
            System.Threading.Thread.CurrentThread.CurrentUICulture = ci;

And... works!

So i suppose that on some computers (not my development Widnows 7 computer that is in italian, but on the Windows 2007 server that also is in italian) using a non english enviroment can cause some issues.

I write this for support to you, if it may help, and to any who may have similar problem.

Thanks for your kind support, it pointed me to the right direction.
Fabrizio

Dilli Babu Nandha Gopal [Syncfusion]
Replied On February 18, 2015 11:12 AM UTC

Hi Fabrizio,

Thank you for updating us.

We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,

Dilli babu.



CONFIRMATION

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.

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

;