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.

Ignoring top 2 rows while reading report data??

Thread ID:

Created:

Updated:

Platform:

Replies:

60449 May 4,2007 02:43 PM May 7,2007 03:03 AM ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
Ryan
Asked On May 4, 2007 02:43 PM

I have to read ALMOST all of the data contained on a pre-existing excel spreadsheet and then place this data onto a new worksheet however I need to avoid reading the top 2 rows and I don't know how.

I'm reading data by using the following:
dataTable = sheet.ExportDataTable(sheet.UsedRange, ExcelExportDataTableOptions.ColumnNames);

This is grabbing all rows however. Is there a way I can grab all rows except for rows 1 & 2?

Thanks.
-Ryan

Melba Winshia [Syncfusion]
Replied On May 7, 2007 03:03 AM

Hi Ryan,

You can use the following code snippet to avoid reading the top 2 rows:

[C#]

//Read data from spreadsheet
DataTable customersTable = sheet.ExportDataTable(3, 1, sheet.UsedRange.End.Row, sheet.UsedRange.End.Column, ExcelExportDataTableOptions.ColumnNames);

Here is the sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Web/4.4.0.51/60449/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba

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.

;