Display Value different from Underlying Value
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=14034
Printed Date: 14 November 2024 at 11:40pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Display Value different from Underlying Value
Posted By: jpbro
Subject: Display Value different from Underlying Value
Date 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
|
Replies:
Posted By: jpbro
Date 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
|
Posted By: MNovaro
Date 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
|
Posted By: jpbro
Date 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
|
|