Android Question jexcel BackgroundColor RGB

sigster

Active Member
Licensed User
Longtime User
Hi

is it poseble to change BackgroundColor using Colors.RGB(0, 255, 0)

cellFormat.BackgroundColor = cellFormat.COLOR_GREY_25_PERCENT:


Sigster
 

teddybear

Well-Known Member
Licensed User
Hi

is it poseble to change BackgroundColor using Colors.RGB(0, 255, 0)

cellFormat.BackgroundColor = cellFormat.COLOR_GREY_25_PERCENT:


Sigster
Yes, you can change BackgroundColor using RGB value, but you need to override the color member of the cellFormat using javaobject or convert RGB color to jxl.format.Color with inline java.

B4X:
Dim j as javaobject = newWorkbook
j.runmethod("setColourRGB", Array(cellFormat.COLOR_GREY_25_PERCENT, 0, 255, 0))
cellFormat.BackgroundColor = cellFormat.COLOR_GREY_25_PERCENT
 
Upvote 0

sigster

Active Member
Licensed User
Longtime User
it don't change the color
how can I connect this java to = cell.SetCellFormat(rowsFormat)

B4X:
            Dim j As JavaObject = newWorkbook
            j.runmethod("setColourRGB", Array(cellFormat.COLOR_GREY_25_PERCENT, 51, 51, 255))
            cellFormat.BackgroundColor = cellFormat.COLOR_GREY_25_PERCENT           
            
            cell.InitializeText(1, RowCount, colorcode)           
            sheet1.AddCell(cell)
            cell.SetCellFormat(rowsFormat)
 
Upvote 0

sigster

Active Member
Licensed User
Longtime User
Sorry I can change color
but I need to change RGB color inside Do While Crsr.NextRow when I get RGB color from the database
 
Upvote 0
Top