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.

sheet.InsertRow degrading with each additional insert

Thread ID:

Created:

Updated:

Platform:

Replies:

27376 Apr 11,2005 03:41 PM Apr 19,2005 12:46 PM Windows Forms 2
loading
Tags: XlsIO
Todd Davis
Asked On April 11, 2005 03:41 PM

Here is our situation. We have an xls template file that we use to generate a new book/sheet. We iterate on the sheet''s names, and if it matches the format "Table.abcd" we do an ImportDataTable on table abcd from a supplied DataSet. The problem arises if we attempt to do an InsertRow for each incoming row in the data table before we do the import. This is desirable because if there is "footer" information below the table placeholder, we would like the import to happen within an area that won''t overwrite other cells in our template. It works fine if the importing table has just a few rows, but if we attempt to import a table with as little as 255 rows, asp.net hits hundreds of megs of usage, CPU pegs, and the entire request times out. Removing these lines solved the problem: for (int i = 0; i < table.Rows.Count - 1; i++) { templateSheet.InsertRow(startingRow.Row + 1); } In a future release, will inserting a block of rows at once be supported or will the degenerative nature of calling InsertRow more than once or twice be addressed? Is there a work around that will solve out issue that we could use but are not? Thanks, Todd

Administrator [Syncfusion]
Replied On April 19, 2005 12:30 PM

Hi Todd, Sorry for the delay in getting back to you. I am able to see the issue with memory usage when rows are inserted. We will look into this issue. 1) As a temporary workaround you could use IRange.MoveTo to accompolish what you require. See attached sample. InsertRows 2) We will also look into having a method for inserting several rows at once. Thanks, Stephen. >Here is our situation. We have an xls template file that we use to generate a new book/sheet. We iterate on the sheet''s names, and if it matches the format "Table.abcd" we do an ImportDataTable on table abcd from a supplied DataSet. > >The problem arises if we attempt to do an InsertRow for each incoming row in the data table before we do the import. This is desirable because if there is "footer" information below the table placeholder, we would like the import to happen within an area that won''t overwrite other cells in our template. It works fine if the importing table has just a few rows, but if we attempt to import a table with as little as 255 rows, asp.net hits hundreds of megs of usage, CPU pegs, and the entire request times out. Removing these lines solved the problem: > >for (int i = 0; i < table.Rows.Count - 1; i++) >{ > templateSheet.InsertRow(startingRow.Row + 1); >} > >In a future release, will inserting a block of rows at once be supported or will the degenerative nature of calling InsertRow more than once or twice be addressed? Is there a work around that will solve out issue that we could use but are not? > >Thanks, >Todd

Administrator [Syncfusion]
Replied On April 19, 2005 12:46 PM

Hi Todd, You can track the live status of this issue here http://www.syncfusion.com/support/issues/excelrw/Default.aspx?ToDo=view&questId=236 Thanks, Stephen. >Here is our situation. We have an xls template file that we use to generate a new book/sheet. We iterate on the sheet''s names, and if it matches the format "Table.abcd" we do an ImportDataTable on table abcd from a supplied DataSet. > >The problem arises if we attempt to do an InsertRow for each incoming row in the data table before we do the import. This is desirable because if there is "footer" information below the table placeholder, we would like the import to happen within an area that won''t overwrite other cells in our template. It works fine if the importing table has just a few rows, but if we attempt to import a table with as little as 255 rows, asp.net hits hundreds of megs of usage, CPU pegs, and the entire request times out. Removing these lines solved the problem: > >for (int i = 0; i < table.Rows.Count - 1; i++) >{ > templateSheet.InsertRow(startingRow.Row + 1); >} > >In a future release, will inserting a block of rows at once be supported or will the degenerative nature of calling InsertRow more than once or twice be addressed? Is there a work around that will solve out issue that we could use but are not? > >Thanks, >Todd

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.

;