In the Manage DataGroup Annotation Cells dialog > DataGroup Information section you select and format the DataGroup Information that you would like to see in your DataGroup Annotation Cells.
So what if the format you want is not available or, if using an available format with values of variable length with following dumb text, results in uneven spacing or overlapping between the variable DataGroup Information and the dumb text?
What goes in these blank fields is fairly obvious once you get to grips with the basics of the VBA Editor:
In this example, and it makes more sense backwards:
Click OK and use the Place Text button to add the text to your DataGroup Annotation Cell. Ensure that the Length is sufficient to contain the DataGroup value and any surrounding text.
In this example I want to place a Label that has a prefix, 'FR |', the Fire rating of a door from the DataGroup, followed by a suffix.
The VBA code is:
Public Sub Door_FireRating() Dim DoorFR As String Dim DoorFRLabel As String DoorFR = KeyinArguments DoorFRLabel = "FR | " + DoorFR + " suffix" KeyinArguments = DoorFRLabelEnd Sub
Starts Public Sub and names Door_FireRating() the function.
Lines 2 and 3
Declares Dim the variables DoorFR to be used and their type As String.
Set variable DoorFR equal to KeyinArguments. KeyinArguements gathers the value from the DataGroup.
Sets DoorFRLabel equal to the concatenation of the plain text contained within the quotation marks "FR | " and the value set for DoorFR into a string to be used in Line 8.
Note that the quotation marks need to contain any spaces you want between words in the text string that is finally output. Here there are spaces either side of the pipe character and a space before suffix.
The + character is the concatenation operator that joins them all together.
Sets KeyinArgument equal to the string concatenated by Line 7.
Closes End Sub the function.
The .MVBA file containg this code needs to be located in your daatset VBA folder to be found by the Auto Annotation process.
Other examples can be found in DG_Annotation.mvba located in the delivered dataset VBA folder.
One warning: because the VBA does have to run for each piece of annotation that uses it, you could see a performance hit in Dynamic Views that contain a large number of annotations that reference a vba.
'2 Hr. Fire rating' and '3 Hr. Fire rating' are values gathered from the NM Dataset. These values will vary between datasets.