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.

ImportDataTable doesn''t add rows?

Thread ID:

Created:

Updated:

Platform:

Replies:

102414 Jan 30,2012 08:17 AM Feb 3,2012 07:18 AM ASP.NET Web Forms (Classic) 3
loading
Tags: XlsIO
Johan GONTRAND
Asked On January 30, 2012 08:17 AM

Hi,

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.

Thx.

ps : sry for my english.


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

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
sheet.InsertRow(1);

//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.

Thanks,
Sridhar.S


Johan GONTRAND
Replied On February 2, 2012 10:59 AM

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

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

http://help.syncfusion.com/resources/Content/ug_101/reporting/xlsio/asp.net/default.htm#!documents/templatemarkers.htm

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

http://asp.syncfusion.com/sfaspnetsamplebrowser/10.1.0.44/Web/XlsIO.Web/samples/4.0/Data%20Binding/TemplateMarker/CS/TemplateMarker.aspx


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

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.

;