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.

Writing Range into an Excel Sheet

Thread ID:

Created:

Updated:

Platform:

Replies:

103459 May 4,2012 01:46 AM May 14,2012 04:33 AM Windows Forms 5
loading
Tags: XlsIO
Amber
Asked On May 4, 2012 01:46 AM

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 06:47 AM

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.
 
Thanks,
Sridhar.S
 

Amber
Replied On May 11, 2012 02:55 AM

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 07:46 AM

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.

 

http://help.syncfusion.com/UG/Reporting/XlsIO/ASP.NET/default.htm#!Documents/improvingperformance.htm

 

Please let me know if you require any further clarifications.

 

Thanks,

Sridhar.S


Amber
Replied On May 12, 2012 02:17 AM

Hey thanks Sridhar!

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

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

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.

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.

;