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

ImportDataTable doesn''t add rows?

Thread ID:





102414 Jan 30,2012 01:17 PM UTC Feb 3,2012 12:18 PM UTC ASP.NET Web Forms (Classic) 3
Tags: XlsIO
Asked On January 30, 2012 01:17 PM UTC


I'm actually evaluating XlsIO, and I can't find a way to make the ImportDataTable method to add rows. I mean I want to insert rows from a dataset into an Excel template, but I have other datas below. At the moment, the rows aren't "inserted", and cells below the table are overwritten.
The only way I managed to do that, was to use use markers, as your sample does.


ps : sry for my english.

Sridhar [Syncfusion]
Replied On February 1, 2012 05:49 PM UTC

Hi Gontrand,

Thank you for using Syncfusion products.

The ImportDataTable() import the data table value which overwrites the contents of the cells at the specfied range.

We request you to use the following code to insert the rows before importing the datatable so that cells are not overwritten while importing the data.

Code Snippet [C#]:

//Insert the row with default formatting at the specified index

//Insert the row with default formatting at the specified index for the specified count
sheet.InsertRow(1, 10);

//Insert the row at the specified index for the specified count as the previous row formatting
sheet.InsertRow(1, 2, ExcelInsertOptions.FormatAsBefore);

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


Replied On February 2, 2012 03:59 PM UTC

Ok, so I have to do it myself.

Is there a way to add rows between two cols only? I mean if I have something in my template aside the table I want to fill, it will be pushed down by adding new rows and I don't want to have this behaviour.
I hope you'll understand what I mean :)

BTW, thx for your answer.

Sridhar [Syncfusion]
Replied On February 3, 2012 12:18 PM UTC

Hi Gontrand,

Thank you so much for the update.

By default, with MS Excel if we insert a row or column it has been inserted for an entire row or entire column. So it is no possible to insert a row between the two columns.
If you have table filled with the columns at the right side, then you can move them to the Bottom side where you need to insert the rows.

We regret to let you know that we have an Template Marker which replaces the data at run time. Please go through the following online documentation link for more details on TemplateMarker


Also , please go through the following online sample link for more details.


Please let me know if you have any other further queries.



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

This page will automatically be redirected to the 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