Hi,I'm using Aspose.Cells v7.1.2.0 (3/12/2012) / Visual Studio 2008 ASP.Net / VB.NetMy code is fairly simple. I have a template xlsx file with headers that I load / rename and populate with data from a data reader.Based on values from the data reader I want to set the background color to either light green or gray. I've tried implementaions of every example I could find but to no avail.
Dim oWorkbook As Workbook = New Workbook(sOutputFileName)
Dim oWorksheet As Worksheet = oWorkbook.Worksheets("Users")
Dim oStyleNo = oWorkbook.Styles(oWorkbook.Styles.Add)
Dim oStyleYes = oWorkbook.Styles(oWorkbook.Styles.Add)
oStyleNo.BackgroundColor = System.Drawing.Color.Gray
oStyleNo.Pattern = BackgroundType.Solid
oStyleYes.BackgroundColor = System.Drawing.Color.LightGreen
oStyleYes.Pattern = BackgroundType.SolidoWorksheet.Cells(iRow, 11).PutValue(drUserAudit(
“IsAssetAnalyst”))
oWorksheet.Cells(iRow, 11).SetStyle(oStyleYes)–
Above doesn’t work
----
oStyle = oWorksheet.Cells(iRow, 0).GetStyle()
oStyle.ForegroundColor = System.Drawing.Color.Yellow
oStyle.Pattern = BackgroundType.Solid
oWorksheet.Cells(iRow, 0).SetStyle(oStyle)
oStyle = oWorksheet.Cells(iRow, 0).GetStyle()
oStyle.ForegroundColor = System.Drawing.Color.Yellow
oStyle.Pattern = BackgroundType.Solid
oWorksheet.Cells(iRow, 0).SetStyle(oStyle)
---
Above doesn't work.
----
I could really use some help with this.
Thanks,
Bill