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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Specify alphabets for first column and last column in importWorkSheet.ExportDataTable

Thread ID:

Created:

Updated:

Platform:

Replies:

37623 Nov 28,2005 12:14 PM UTC Nov 30,2005 12:26 PM UTC WinForms 5
loading
Tags: XlsIO
Prathima Venkobachar
Asked On November 28, 2005 12:14 PM UTC

Hi, I want to export data from the excel to datatable. I am using IWorksheet importWorkSheet = importWorkBook.Worksheets[0]; dtExcelImport = importWorkSheet.ExportDataTable(firstRow, firstColumn, firstRow, lastColumn, ExcelExportDataTableOptions.ComputedFormulaValues); I want to specify the alphabets for the first column and last column(lets say from A - AA). But importWorkSheet.ExportDataTable() takes int. How can I do this..? Thanks and Regards, Prathima

Administrator [Syncfusion]
Replied On November 29, 2005 06:23 AM UTC

Hi Prathima, The Sheet.ExportDataTable() method takes the rows and columns as integers. I herewith attach a Sample for your reference: exportdatatable.zip Please take a look and let me know if you have any questions. Thanks for your interest with Syncfusion products. Best Regards, Seetha >Hi, > >I want to export data from the excel to datatable. > >I am using >IWorksheet importWorkSheet = importWorkBook.Worksheets[0]; >dtExcelImport = importWorkSheet.ExportDataTable(firstRow, firstColumn, firstRow, lastColumn, ExcelExportDataTableOptions.ComputedFormulaValues); > >I want to specify the alphabets for the first column and last column(lets say from A - AA). >But importWorkSheet.ExportDataTable() takes int. >How can I do this..? > >Thanks and Regards, >Prathima

Administrator [Syncfusion]
Replied On November 29, 2005 06:33 AM UTC

Hi Prathima, Sorry for the inconvenience caused. Here is the correct link: exportdatatable.zip Best Regards, Seetha >Hi, > >I want to export data from the excel to datatable. > >I am using >IWorksheet importWorkSheet = importWorkBook.Worksheets[0]; >dtExcelImport = importWorkSheet.ExportDataTable(firstRow, firstColumn, firstRow, lastColumn, ExcelExportDataTableOptions.ComputedFormulaValues); > >I want to specify the alphabets for the first column and last column(lets say from A - AA). >But importWorkSheet.ExportDataTable() takes int. >How can I do this..? > >Thanks and Regards, >Prathima

Prathima Venkobachar
Replied On November 29, 2005 12:31 PM UTC

Hi Seetha, Thanks for the reply. Example is understanding. I have a requirement, where in I have to specify the - first row,first column, max rows , max column where in the users specify in alphabets first column and last column(i.e. from A - AA). in your example, it takes only the first column["A"](if I understood correctly): // Another way to specify DataTable customersTable = sheet.ExportDataTable(sheet.Range["A"],ExcelExportDataTableOptions.ComputedFormulaValues); How can I handle this type of situation. Thanks, Prathima >Hi Prathima, > >Sorry for the inconvenience caused. > >Here is the correct link: > >exportdatatable.zip > >Best Regards, >Seetha > > >>Hi, >> >>I want to export data from the excel to datatable. >> >>I am using >>IWorksheet importWorkSheet = importWorkBook.Worksheets[0]; >>dtExcelImport = importWorkSheet.ExportDataTable(firstRow, firstColumn, firstRow, lastColumn, ExcelExportDataTableOptions.ComputedFormulaValues); >> >>I want to specify the alphabets for the first column and last column(lets say from A - AA). >>But importWorkSheet.ExportDataTable() takes int. >>How can I do this..? >> >>Thanks and Regards, >>Prathima

Administrator [Syncfusion]
Replied On November 30, 2005 05:59 AM UTC

Hi Prathima, I herewith attach a workaround for your requirement: datatable632689457583139522.zip Please take a look and let me know if you have any questions. Thanks for your interest with Syncfusion products. Best Regards, Seetha >Hi Seetha, > >Thanks for the reply. >Example is understanding. >I have a requirement, where in I have to specify the - first row,first column, max rows , max column where in the users specify in alphabets first column and last column(i.e. from A - AA). > >in your example, it takes only the first column["A"](if I understood correctly): > >// Another way to specify >DataTable customersTable = sheet.ExportDataTable(sheet.Range["A"],ExcelExportDataTableOptions.ComputedFormulaValues); > >How can I handle this type of situation. > >Thanks, >Prathima > > > >>Hi Prathima, >> >>Sorry for the inconvenience caused. >> >>Here is the correct link: >> >>exportdatatable.zip >> >>Best Regards, >>Seetha >> >> >>>Hi, >>> >>>I want to export data from the excel to datatable. >>> >>>I am using >>>IWorksheet importWorkSheet = importWorkBook.Worksheets[0]; >>>dtExcelImport = importWorkSheet.ExportDataTable(firstRow, firstColumn, firstRow, lastColumn, ExcelExportDataTableOptions.ComputedFormulaValues); >>> >>>I want to specify the alphabets for the first column and last column(lets say from A - AA). >>>But importWorkSheet.ExportDataTable() takes int. >>>How can I do this..? >>> >>>Thanks and Regards, >>>Prathima

Administrator [Syncfusion]
Replied On November 30, 2005 12:26 PM UTC

Hi Prathima, There is no direct way to do this but here is some code sample that might help string addFrom = this.textBox1.Text + "1"; IRange rngFrom = sheet.Range[addFrom]; int startCol = rngFrom.Column; string addTo = this.textBox2.Text + "1"; IRange rngTo = sheet.Range[addTo]; int endCol = rngTo.Column; DataTable dt = sheet.ExportDataTable(1,startCol,sheet.UsedRange.End.Row,endCol,ExcelExportDataTableOptions.None); this.dataGrid1.DataSource = dt; Here is the modified sample DataTable.zip We will also add an overload to the ExportDataTable method that would take the column Alphabet. Please let me know if you have any questions. Thanks, Stephen.

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.

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

;