Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Colored Semilar ITEM
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Colored Semilar ITEM

 Post Reply Post Reply
Author
Message
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Topic: Colored Semilar ITEM
    Posted: 11 September 2010 at 6:52am
Hi Expert!


Just would like to ask on how to color semilar data.  Like the "UNIT" column.






Any help would be greatly appreciated. Thank you!
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2010 at 5:20am
Hi,
 
You can use BeforeDrawRow event to accomplish this...
 
Me.wndReportControl.SetCustomDraw xtpCustomBeforeDrawRow 'enable BeforeDrawRow event
 
Private Sub wndReportControl_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
    Select Case Row.Record(3).Value
        Case "BOX"
            Metrics.BackColor = vbGreen
        Case "CAN"
            Metrics.BackColor = vbCyan
    End Select
End Sub
 
 
OR
 
Just assign BackColor to ReportItem when created
 
With Me.wndReportControl.Records.Add
    With .AddItem("BOX")
        .BackColor = vbGreen
    End With
End With
 
 
If you want more "tricks" BeforeDrawRow event is THE event to use without changing original values of ReportItem. Metrics is using "copy" of Row/Record collection and you are able to do a lot of "tricks" in it. I would recommend this rather than assigning value when creating ReportItem.
 
Hope this helps Wink
 
  
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 19 September 2010 at 8:29pm
Hi Aaron,

Thank you for your reply...
But what if the "unit" are more than hundreds or thousands, is there any other way not to declare the value of "unit" and group the "unit" value by color and randomly select any color.. is it possible?

thanks..
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.