Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Display Value different from Underlying Value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Display Value different from Underlying Value

 Post Reply Post Reply
Author
Message
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Topic: Display Value different from Underlying Value
    Posted: 15 April 2009 at 7:56pm
Is it possible to have display values that are different from the underlying values in a cell?

For example, if I have a Date column, I might store the underlying data in ISO8601 format, but then I would like to display friendly names for certains dates (i.e. the underlying data for today would be  2009-04-15T20:07Z, but I would like the ReportControl cell to show "Today at 3PM" (time adjusted for time zone)).  Older dates might show "Yesterday" or "Last Week", etc... instead of the full date. However, because the underlying data stores actual database values, sorting and searching would take place on those values instead of on the displayed (cosmetic only) values.

Is this possible with the ReportControl currently?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2009 at 11:07pm
Okay, I think I have figured out how to do this with BeforeDrawRow event custom handling of the Metrics object. I will post a sample at some point if all goes well.

Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
MNovaro View Drop Down
Groupie
Groupie
Avatar

Joined: 20 June 2006
Status: Offline
Points: 71
Post Options Post Options   Thanks (0) Thanks(0)   Quote MNovaro Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2009 at 3:16am
Wouldn't be easier to set the .Caption of the record Item when you populate the report:

Item.Value = 2009-04-15T20:07Z
Item.Captin = "Today at 3PM"

HTH
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2009 at 9:53am
Thanks Marco. That's useful information (that the Value property can be separate from the Caption property, and I assume the ReportControl sorts on the Value property). The reason I am now using the BeforeDrawRow event is because I am working with the ReportControl in VirtualMode (since I haven't been able to get Bound mode to work with my SQLite database provider yet). 
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

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.