Sub Button2_Click
sq.Initialize(File.DirRootExternal&"/xxx", "data.db", False)
sel=sq.ExecQuery("SELECT * FROM evolucion")
Dim col As Int
col=sel.ColumnCount
Dim ro As Int
Dim newWorkbook As WritableWorkbook
newWorkbook.Initialize(File.DirRootExternal&"/bebe/xls/","1.xls")
Dim sheet1 As WritableSheet
sheet1 = newWorkbook.AddSheet("Movies", 0)
Dim cellFormat As WritableCellFormat
cellFormat.Initialize2(cellFormat.FONT_ARIAL, 12, True, False, False, _
cellFormat.COLOR_GREEN)
cellFormat.HorizontalAlignment = cellFormat.HALIGN_CENTRE
cellFormat.SetBorder(cellFormat.BORDER_ALL, _
cellFormat.BORDER_STYLE_MEDIUM, cellFormat.COLOR_BLACK)
cellFormat.SetBorder(cellFormat.BORDER_BOTTOM, cellFormat.BORDER_STYLE_THICK, _
cellFormat.COLOR_BLUE)
cellFormat.VertivalAlignment = cellFormat.VALIGN_CENTRE
cellFormat.BackgroundColor = cellFormat.COLOR_GREY_25_PERCENT
sheet1.SetColumnWidth(1, 40)
sheet1.SetRowHeight(0, 15)
Dim rowsFormat As WritableCellFormat
rowsFormat.Initialize
rowsFormat.HorizontalAlignment = rowsFormat.HALIGN_CENTRE
ro=sel.RowCount-1
Dim col As Int = sel.ColumnCount-1
Log (sel)
For row = 0 To ro
sel.Position=row
For co = 0 To col
Dim cell As WritableCell
d1=sel.GetInt2(co)
d2=sel.GetInt2(row)
cell.InitializeText(co, row , sel.GetString2(co))
cell.SetCellFormat(rowsFormat)
sheet1.AddCell(cell)
Next
Next
newWorkbook.Write
newWorkbook.Close
End Sub