Dim su As StringUtils
Dim su1 As String
Dim newWorkbook As WritableWorkbook
newWorkbook.Initialize(File.DirDefaultExternal, "SIPC_INSPECTION.xls")
Dim sheet1 As WritableSheet
sheet1 = newWorkbook.AddSheet("Inspection list", 0)
'we create a special format for the headers
Dim cellFormat As WritableCellFormat
'add the data
Dim rowsFormat As WritableCellFormat
rowsFormat.Initialize
rowsFormat.HorizontalAlignment = rowsFormat.HALIGN_CENTRE
rowsFormat.VertivalAlignment = rowsFormat.VALIGN_CENTRE
rowsFormat.Initialize2(rowsFormat.FONT_ARIAL, 12, True, False, False, rowsFormat.COLOR_GREEN)
Cursor1 = sql1.ExecQuery("SELECT *FROM cam where cam_code ='" & s_code & "'")
For i=0 To Cursor1.RowCount -1
Cursor1.Position =i
su1=su.EncodeBase64 (Cursor1.GetBlob("cam_picture"))
Msgbox (su1,"")
Dim cell As WritableCell
cell.InitializeText(0, i, Cursor1.GetString("cam_title") & " : " & Cursor1.GetString("cam_note"))
'cell.InitializeText(1, i, su1 )
cell.InitializeFormula(1, i, su1)
'cell.SetCellFormat(rowsFormat)
sheet1.AddCell(cell)
Next
Cursor1.Close
'Must call write and close to save the data.
newWorkbook.Write
newWorkbook.Close