Print Page | Close Window

Colored Semilar ITEM

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17232
Printed Date: 15 November 2024 at 1:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Colored Semilar ITEM
Posted By: JamGodz
Subject: Colored Semilar ITEM
Date 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!



Replies:
Posted By: Aaron
Date 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....


Posted By: JamGodz
Date 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..



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net