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

Proper user of MigrantRange

I am looking for an example of the proper use of MigrantRange

I am rendering my own excel report and I need to be as efficient as possible. We have some customers that have over 120 000 rows with approx 14 columns.
Writing to excel like this
Excel[row, col].Text = value
Excel[row,col].CellStyle. =
is just not efficient.

I understand that MigrantRange works very efficiently. How do I use it
1 - get Excel.MigrantRange[row, col, lastRow,lastCol]
2 - pass my new IRange to my method
3 - use my new range created from MigrantRange

I have also heard some rumblings about MigrantRangeImpl. Which is better

Please advise ,
Thanks



1 Reply

GM Geetha M Syncfusion Team December 12, 2008 07:14 AM UTC

Hi Kelley,

Thank you for your interest in Syncfusion products.

In order to set column / row style for large number of rows, you can use SetDefaultRowStyle and SetDefaultColumnStyle. Here is the code snippet for this:

sheet.SetDefaultColumnStyle(1, colCount, bodyStyle);

This will reduce the time consumption to a great extent.

Use of Migrant Range will reduce the memory consumption, particularly when using large number of strings. Please go through our Performance sample in the below location (shipped with installation) which demonstrates both Style and MigrantRange:

My Documents\Syncfusion\EssentialStudio\{Version Number}\Windows\XlsIO.Windows\Samples\2.0\Featured Samples\Performance\CS\

Please let me know if you have any questions.

Regards,
Geetha


Loader.
Live Chat Icon For mobile
Up arrow icon