﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » Using custom properties to bind report fields</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 06 Apr 2026 22:07:20 GMT</lastBuildDate><ttl>20</ttl><item><title>Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15156.aspx</link><description>I am using DevExpress XtraReports and have been able to make it work using a BusinessBindingSource as a DataSource, and then linking that BBS to a BO which has my report data in it.&amp;nbsp; I have done this many times already and have had no problems thus far.&amp;nbsp; I have been working on a problem for the past few days and haven't been able to figure out a solution.&lt;/P&gt;&lt;P&gt;I have several custom field properties on my BO which I have bound to fields in my report.&amp;nbsp; There are also several "regular" BO properties which link directly to fields in the db table.&amp;nbsp; The custom fields are all showing as blank, but the regular properties are showing as the correct values.&amp;nbsp; I don't think it is even getting to the code for the custom properties since I have set break points in them which are not getting hit.&amp;nbsp; I even tried hardcoding one of them to return a string value which also didnt show up.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Its almost like it doesnt know how to find the custom properties.&amp;nbsp; I thought it was a problem with the binding, but if it can find the non-custom properties then it is binding correctly (I think).&amp;nbsp; Here is an example of one of the custom properties:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&amp;lt;Browsable(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;False&lt;/FONT&gt;&lt;FONT size=2&gt;), _&lt;BR&gt;BusinessFieldDisplayInEditor(), _&lt;BR&gt;DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)&amp;gt; _&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Public&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ReadOnly&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/FONT&gt;&lt;FONT size=2&gt; TransferAmt() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Decimal&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; Get &lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;FONT size=2&gt; FixAmt(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;FONT size=2&gt;.CurrentRow.Item(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"TransferAmt"&lt;/FONT&gt;&lt;FONT size=2&gt;))&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Get&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Property&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;And I am also adding the custom property descriptors as I am supposed to, like the following:&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;P&gt;Protected&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Overrides&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; GetCustomBindablePropertyDescriptors() &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt; MicroFour.StrataFrame.Business.FieldPropertyDescriptor()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Return&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _&lt;BR&gt;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"FacilityDescr"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;GetType&lt;/FONT&gt;&lt;FONT size=2&gt;(DailyTransactions)), _&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; New&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"DisburseAmt"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;GetType&lt;/FONT&gt;&lt;FONT size=2&gt;(DailyTransactions)), _&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; New&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"PaymentAmt"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;GetType&lt;/FONT&gt;&lt;FONT size=2&gt;(DailyTransactions)), _&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; New&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"StmtAmt"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;GetType&lt;/FONT&gt;&lt;FONT size=2&gt;(DailyTransactions)), _&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; New&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"FeePostAmt"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;GetType&lt;/FONT&gt;&lt;FONT size=2&gt;(DailyTransactions)), _&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp; New&lt;/FONT&gt;&lt;FONT size=2&gt; MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;"TransferAmt"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;GetType&lt;/FONT&gt;&lt;FONT size=2&gt;(DailyTransactions))}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Function&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;Any advice, ideas, suggestions, etc?&amp;nbsp; Thanks!&amp;nbsp; I'm really stuck on this one.</description><pubDate>Wed, 26 Mar 2008 16:05:32 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15188.aspx</link><description>Hi Andrea,&lt;/P&gt;&lt;P&gt;Actually I wasn't suggesting this as an alternate way of doing the same thing. It actually fixed a problem I had in that it forced .Net to do the 'right thing'. Refer:&lt;/P&gt;&lt;P&gt;&lt;A href="http://forum.strataframe.net/Topic13021-10-1.aspx"&gt;http://forum.strataframe.net/Topic13021-10-1.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Wed, 26 Mar 2008 16:05:32 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15170.aspx</link><description>Peter is right in that this can be a time saver....however, in this particular scenario, I would caution you against using the me.GetType().&amp;nbsp; In this particular scenario since you are inheriting from another business object and extending that object, this can cause an issue when binding.&amp;nbsp; &lt;P&gt;Using the GetType(MyBo) is actually safer here since it is not pulling from the reference.&amp;nbsp; You can take the shortcut that Peter mentioned though, just use the GetType(MyBo) instead of the me.GetType() to get that reference:&lt;/P&gt;&lt;P&gt;[codesnippet]Dim myType As System.Type = GetType(MyBo)[/codesnippet]</description><pubDate>Tue, 25 Mar 2008 20:31:03 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15169.aspx</link><description>Ah, thanks.&amp;nbsp; That seems like an obvious time saver but I never noticed it before.&amp;nbsp; Good tip!&lt;/P&gt;&lt;P&gt;Trent, I'll try adding that in and see if it works for me.&amp;nbsp; Thanks!</description><pubDate>Tue, 25 Mar 2008 17:45:17 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15168.aspx</link><description>Hi Andria,&lt;/P&gt;&lt;P&gt;Don't know if this will help or not but this is another approach to Type Descripters that Trent or Ben gave me advice on a little while ago:&lt;/P&gt;&lt;P&gt;Protected Overrides Function GetCustomBindablePropertyDescriptors() As MicroFour.StrataFrame.Business.FieldPropertyDescriptor()&lt;/P&gt;&lt;P&gt;Dim DailyTran As System.Type = Me.GetType()&lt;/P&gt;&lt;P&gt;Return New MicroFour.StrataFrame.Business.FieldPropertyDescriptor() { _&lt;BR&gt;&amp;nbsp; New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("FacilityDescr", DailyTran), _&lt;BR&gt;&amp;nbsp; New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("DisburseAmt", DailyTran), _&lt;BR&gt;&amp;nbsp; New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("PaymentAmt", DailyTran), _&lt;BR&gt;&amp;nbsp; New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("StmtAmt", DailyTran), _&lt;BR&gt;&amp;nbsp; New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("FeePostAmt", DailyTran), _&lt;BR&gt;&amp;nbsp; New MicroFour.StrataFrame.Business.ReflectionPropertyDescriptor("TransferAmt", DailyTran)}&lt;/P&gt;&lt;P&gt;End Function&lt;BR&gt;&lt;/P&gt;&lt;P&gt;Cheers, Peter</description><pubDate>Tue, 25 Mar 2008 17:40:14 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15164.aspx</link><description>Just create a private and manage this manually for this BO.&amp;nbsp; If will look like this:&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;/P&gt;&lt;P&gt;&lt;BR&gt;Private Shared _AreCustomDescriptorsEvaluated As Boolean = False&lt;/P&gt;&lt;P&gt;''' &amp;lt;summary&amp;gt;&lt;BR&gt;''' Determine if the custom descriptors are going to be evaluated&lt;BR&gt;''' &amp;lt;/summary&amp;gt;&lt;BR&gt;''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;BR&gt;Protected Overrides ReadOnly Property AreCustomDescriptorsEvaluated() As Boolean&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Establish Locals&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim r As Boolean = _AreCustomDescriptorsEvaluated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Do not eval the desciptors again&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _AreCustomDescriptorsEvaluated = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Return results&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return r&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;End Property[/codesnippet]&lt;/P&gt;&lt;P&gt;Notice that the private is shared...this is an important step.&amp;nbsp; Add this and you will be good to go. :)</description><pubDate>Tue, 25 Mar 2008 17:25:07 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15161.aspx</link><description>You are right on the money.&amp;nbsp; Yes, I am inheriting from another business object, and yes when I overrode that property it fixed it.&amp;nbsp; So now....how about that permanent solution you were talking about??&amp;nbsp; :)</description><pubDate>Tue, 25 Mar 2008 16:40:46 GMT</pubDate><dc:creator>Andria Jensen</dc:creator></item><item><title>RE: Using custom properties to bind report fields</title><link>http://forum.strataframe.net/FindPost15160.aspx</link><description>Is this business object inheriting from the another business object?&amp;nbsp; For example, do you have a CustomersBO and then this would be something like Customers_ReportBO that inherits the CustomersBO class?&amp;nbsp; There could be some "gotchas" there if this happens.&amp;nbsp; More than likely this is related to the .NET binding not reevaluating the type descriptors.&amp;nbsp; You can override a property on the BO called AreCustomDescriptorsEvaluated.&amp;nbsp; You can override this and, just for a test, return False.&amp;nbsp; This will be slow and if it resolves the issue I can tell you a permanent work around.&lt;/P&gt;&lt;P&gt;[codesnippet]Protected Overrides ReadOnly Property AreCustomDescriptorsEvaluated() As Boolean&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return False&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Get&lt;BR&gt;End Property[/codesnippet]&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; DO NOT LEAVE THIS CODE AFTER TESTING!!! :)</description><pubDate>Tue, 25 Mar 2008 14:39:19 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>