Colored Semilar ITEM |
Post Reply |
Author | |
JamGodz
Groupie Joined: 25 February 2010 Status: Offline Points: 67 |
Post Options
Thanks(0)
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! |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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 SelectEnd 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
|
|
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.... |
|
JamGodz
Groupie Joined: 25 February 2010 Status: Offline Points: 67 |
Post Options
Thanks(0)
|
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.. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |