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

Writing Range into an Excel Sheet

Thread ID:





103459 May 4,2012 05:46 AM UTC May 14,2012 08:33 AM UTC WinForms 5
Tags: XlsIO
Asked On May 4, 2012 05:46 AM UTC

How can i write an entire range into an excel sheet row in Syncfusion?
PS[I have just switched from Interop to Syncfusion. And I am able to read an entire row into an Syncfusion.XlsIO.IRange[] array. However, I am stuck up in the process of writing an entire row. Is looping through all the cells the only way out? Just to mention, there was a performance lift of 4-5 times from reading entire row to reading cell by cell in case of Interop. So it makes all logical sense that Syncfusion also provides that feature.]

Sridhar [Syncfusion]
Replied On May 7, 2012 10:47 AM UTC

Hi Amber,
Thank you very much for using Syncfusion products.
Could you please let me know whether you need to write a range or group of range (i.e., entire range) to an entire row.
However, Syncfusion Essential XlsIO supports for writing a range to an entire row of an worksheet. We have given below the code snippet for the same.
Code Snippet[C#]:
sheet.Range[2, 2].EntireRow.Value2 = sheet.Range["A1"];
sheet.Range[2, 2].EntireRow.Value = sheet.Range["A1"].DisplayText;
Could you please also get back to us with the source code used to write an entire range into an excel sheet row available with Interop so that we are able to proceed further on this.

Please let me know if you require any further assistance on this.

Replied On May 11, 2012 06:55 AM UTC

Hi Sridhar, 
I want to write an entire row at once without looping. What you are doing here is that you are writing cell by cell in a row. So can't I write an entire array to a row without looping through that array?

Sridhar [Syncfusion]
Replied On May 11, 2012 11:46 AM UTC

Hi Amber,


Thank you so much for the update.


Essential XlsIO, does not support to write the array of values to an Entire row without the loop. However, while looping through the cells we have an optimal method "IMigrantRange interface" for writing the strings with better performance.


We have given below the sample code snippet for the same.


Code Snippet [C#]:


IMigrantRange migrantRange = sheet.MigrantRange;


// Writing Data.


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


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


// Writing values.

migrantRange.ResetRowColumn(row, column);

migrantRange.Text = "Test";




Please try the above code snippet and let us know if this helps you.


Also, please go through the following online documentation link for improving the performance while creating the excel reports.




Please let me know if you require any further clarifications.




Replied On May 12, 2012 06:17 AM UTC

Hey thanks Sridhar!

Sridhar [Syncfusion]
Replied On May 14, 2012 08:33 AM UTC

Hi Amber,
Thanks for the update.
Please let me know if you require any further assistance on this.


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