Actuateclub.com

 

  About Actuate   |   Forums   |   Message Board  |   FAQ   |   Jobs    |   Actuate 100   |   Guest Book  |   Feedback  |   Sitemap   |   Home

Techieindex

 
Changing the color of the fonts depending on the value
In this report we change the color of the value at run time by using BuildFromRow() method
Description
We are creating now a control on the BuildFromRow( ) method which gets fired when data rows are to be passed to the controls. To do this :
First of all create a simple report with one frame, a connection and SQL component.

This also can be done by overriding the Function BuildFromRow( row As AcDataRow ) As AcBuildStatus”, which is used in the previous example.

Type the remaining lines to the function before “BuildFromRow = Super::BuildFromRow( row )”.

"BuildFromRow = Super::BuildFromRow( row )”.
Dim loTextCtr as AcTextControl

     Dim loTextCtr2 as AcTextControl

     Dim loTextCtr3 as AcIntegerControl

     Dim loTextCtr4 as AcTextControl 

     Dim loPurVol as Integer

 loPurVol=row.GetValue("Address_purchaseVolume")

               If loPurVol<3 Then

     BackgroundColor=Red

     Set loTextCtr=FindContentByClass("txtPurVol")

     Set loTextCtr2=FindContentByClass("txtPurFreq")

     Set loTextCtr3=FindContentByClass("txtcustID")

     Set loTextCtr4=FindContentByClass("txtcustcity")

     loTextCtr.Font.Color=Black

     loTextCtr2.Font.Color=Black

     loTextCtr3.Font.Color=Black

     loTextCtr4.Font.Color=Black

    End If




First of all we declare 4 TextControlls. Then loPurVol as Integer variable and sets the value of it to customers purchaseVolume. Then we check it with an if statement and if its value is less than 3 then put the Background Color as red and the text controls color as black. FindContentByClass( ) is a method in container components, such as frames and pages. It locates and returns a reference to a content component given the class name of that component. Then we assign them to loTextCtr, loTextCtr2, loTextCtr3, etc. Then we set the text controls font. color to Black.
 

 

 

 

 

 

Copyright © 2008 Techieindex