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

Getting value from sheet is too slow

Thread ID:

Created:

Updated:

Platform:

Replies:

104144 Jun 25,2012 11:41 AM UTC Jun 29,2012 07:30 AM UTC Silverlight 3
loading
Tags: XlsIO
Jiwon
Asked On June 25, 2012 11:41 AM UTC

    Hi,
I'm using XlsIO in SL.
We want to getting values from each cell in sheet.
The code is like below.
 
--code here--
foreach (IWorksheet sheet in workbook.Worksheets)
                    {
                        for (int row = 1; row <= sheet.Rows.Length; row++)
                        {                           
                            for (int column = 1; column <= sheet.Columns.Length; column++)
                            {
                                object cell = sheet.GetValueRowCol(row, column);
                                //Do something w/ cell
                            }
                        }
                    }     
 
Surely, I tested the performance except for any other logic.
The excel file is amount of 25000(row)*30(column), ti takes about 20 minutes.
Is there faster way of reading each cell?
 
Thank you.
 
 
 

Manikandan M [Syncfusion]
Replied On June 27, 2012 08:40 AM UTC

Hi Jiwon,

 

Thanks for using Syncfusion products.

 

On analysis we found that XlsIO takes 20 min (nearly) to read the cell of the sheet which contains values in 25000 rows and 30 columns as ’sheet.Rows.Length’, 'sheet.Columns.Length' properties are called on each loop execution. So please as workaround, assign the 'sheet.Rows.Length' and 'sheet.Column.Length' to local variable and use that local variable in for loop. When using this workaround, we could see that XlsIO takes 3 seconds to read the cell values.

 

Code snippet:

foreach (IWorksheet sheet in workbook.Worksheets)

            {

                int rowLength = sheet.Rows.Length;

                int columnLength = sheet.Columns.Length;

                for (int row = 1; row <= rowLength; row++)

                {

                    for (int column = 1; column <= columnLength ; column++)

                    {

                        object cell = sheet.GetValueRowCol(row, column);

                        //Do something

                    }

                }

            }

We have attached the simplified sample with the above scenario. Please make use of this and let us know whether this helps you.

 

Thanks,

Manikandan.M

 



Performance_2185a604.zip

Jiwon
Replied On June 27, 2012 11:53 AM UTC

I also found it takes just 3 seconds.
I can't believe that I couldn't try that. 
Thank you.
 
 
  

Manikandan M [Syncfusion]
Replied On June 29, 2012 07:30 AM UTC

Hi Jiwon,

 

Thanks for your update.

 

We are happy to hear that reported issue has been resolved. Please let us know if you need any assistance on this.

 

Thanks,

Manikandan.M


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

;