insert data into an excel worksheet

0

I need to insert data into an excel file and I'm using infragistics.documents.excel to do this.

I needed to know how I see which is the last column with index - In the case of this image would be the URL

I also needed to insert the data into the table as it is stored in a Private Function within a data table

The way you save the data to be saved is as follows

Using t As New DataTable
                da.Fill(t)

                For Each Row In t.Rows
                    Dim e As New ExportLine
                    e.Url = String.Format(Url, Row!ClienteId)
                    e.Nome = Row!Nome
                    e.Telemovel = Row!Telemovel
                    lExportLines.Add(e)
                Next
            End Using
    
asked by anonymous 19.04.2018 / 17:03

1 answer

0

I resolved with

'For Each dados In lExportLines

        oWorksheet.Rows.Item(iRow).Cells(iCol).Value = dados.Nome

        iCol += 1I
        oWorksheet.Rows.Item(iRow).Cells(iCol).Value = dados.Telemovel
        iCol += 1I
        oWorksheet.Rows.Item(iRow).Cells(iCol).Value = dados.Url
        iCol = 1I
        iRow += 1I

    Next'
    
20.04.2018 / 15:33