SAP Knowledge Base Article - Public

1471500 - Using the RAS SDK for VS .NET, how do you set a field's background color?



The following code set the background color:

Private Sub SetBackgroundColorFormula(ByVal pstrFieldName As String, ByVal pstrFormula As String)
Dim col As ISCRReportObject = CType(crRepDef.FindObjectByName(pstrFieldName), ISCRReportObject)
Dim lstr As String = col.Border.ConditionFormulas(CrBorderConditionFormulaTypeEnum.crBorderConditionFormulaTypeBackgroundColor).Text

If lstr Is Nothing Then
  'Create a new formula for this object (i.e. this column in the report)
  Dim cf As ConditionFormula = New ConditionFormula
  Dim colTemp As ISCRReportObject = col
  cf.Text = pstrFormula
  rptDoc.ReportClientDocument.ReportDefController.ReportObjectController.Modify(col, colTemp)
  col.Border.ConditionFormulas(CrBorderConditionFormulaTypeEnum.crBorderConditionFormulaTypeBackgroundColor).Text = pstrFormula
End If
End Sub



Forum Thread , KBA , BI-DEV-NET-SDK , .NET SDK / COM SDK , How To


Crystal Reports 2008 V0 ; Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports XI R2