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.

Reading large excel sheet

Thread ID:

Created:

Updated:

Platform:

Replies:

110278 Jul 26,2013 03:01 AM Jul 30,2013 12:30 AM ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
JESUS PEREZ DEL POSTIGO
Asked On July 26, 2013 03:01 AM

I am trying to read excel sheet and I only returns the contents of the first row.
Bookseller am using the following code Syncfusion.XlsIO.Base.dll and. Attached excel sheet.

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click

Dim excelEngine As ExcelEngine = New ExcelEngine()

Dim application As IApplication = excelEngine.Excel

'Open the existing workbook

Dim workbook As IWorkbook = application.Workbooks.Open("C:\Temporal\Dtos.xlsx")

'The first worksheet object in the worksheets collection is accessed.

Dim sheet As IWorksheet = workbook.Worksheets("Descuentos_Clientes")

Dim j As Int32

 

 

j = 2

 

Dim Id_Cliente, GrupoTarifa, DTO1, DTO2 As String

Id_Cliente = Trim(sheet.Range(j, 1).Text & "")

GrupoTarifa = Trim(sheet.Range(j, 2).Text & "")

DTO1 = Trim(sheet.Range(j, 3).Text & "")

DTO2 = Trim(sheet.Range(j, 4).Text & "")

While Id_Cliente.Trim.Length <> 0 And GrupoTarifa.Trim.Length <> 0

 

 

j = j + 1

 

Id_Cliente = Trim(sheet.Range(j, 1).Text & "")

GrupoTarifa = Trim(sheet.Range(j, 2).Text & "")

DTO1 = Trim(sheet.Range(j, 3).Text & "")

DTO2 = Trim(sheet.Range(j, 4).Text & "")

End While

 

workbook.Close()

 

End Sub



Dtos_9c6ad42b.zip

Sridhar [Syncfusion]
Replied On July 30, 2013 12:30 AM

Hi Jesus Perez Del Postigo,

Thank you for using Syncfusion products.

We could see the given excel file is preserved with number values and does not stored under string values. So, can you please make use of the DisplayText to get the text displayed in the excel cell.

Please get the modified code snippet for the same.

Code Snippet [VB]:

Id_Cliente = Trim(sheet.Range(j, 1).DisplayText & "")
GrupoTarifa = Trim(sheet.Range(j, 2).DisplayText & "")
DTO1 = Trim(sheet.Range(j, 3).DisplayText & "")
DTO2 = Trim(sheet.Range(j, 4).DisplayText & "")

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

Please let me know if you have any further clarifications.

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.

;