Writing Range into an Excel Sheet
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.]
sheet.Range[2, 2].EntireRow.Value = sheet.Range["A1"].DisplayText;
Please let me know if you require any further assistance on this.
Sridhar.S
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.
Thanks,
Sridhar.S
- 5 Replies
- 2 Participants
-
AM Amber
- May 4, 2012 05:46 AM UTC
- May 14, 2012 08:33 AM UTC