Left Justify Description and Right Justify Name in a Cubeview
My rows are my UD3 Dimension, and I want to mimic a current Excel Report. I want to Left Justify the Description and right justify the UD3 Name so it basically looks like this.
Boys garments B100
Mens garments B110
I have this Name function to reverse the Description and Name.
Of course I could add some spaces, but I have Descriptions that vary greatly.
I just wanted to make sure I wasn't missing a statement could make the Member Name property to Right Justify. Any ideas appreciated, otherwise I just get the users to accept it in Name Description format.
Following the screen shots below will get you close. You would have to play with some formatting to get the Nested Member Expansion 2 (i.e., the Description) to be right justified.
There are no justify options available in formatting row or column headers in Cube Views, that I am aware of. It would be nice if you could center as well.
in the member filter property of the row, call an XFBR in the Name function that will format your member they way you want it., add leading spaces, proportionally add padding between description and name, anything you want.
The part before the colon will not appear in the row header, but WILL drive the values in the data cells for that row. This means you can create any row header you want in the XFBR.
a#60999:Name(XFBR(RightLeftJustify, Justify, HeaderCellWidth=80,headerCellText=60999 - Net Sales,DimName=Account))
VB.net
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DashboardStringFunctionArgs) As Object
Try
Return Justify(si, args)
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
Private Function Justify(ByVal si As SessionInfo, ByVal args As DashboardStringFunctionArgs) As String
Dim output As String = String.Empty
Try
Dim dimName As String = args.NameValuePairs.XFGetValue("DimName", String.Empty)
Dim headerCellText As String = args.NameValuePairs.XFGetValue("headerCellText", String.Empty)
Dim headerCellWidth As Integer = Convert.ToInt32(args.NameValuePairs.XFGetValue("HeaderCellWidth", String.Empty))
Dim parts As String() = headerCellText.Split("-"c)
Dim firstPart As String = parts(0).Trim()
Dim secondPart As String = parts(1).Trim()
Dim spacesCount As Integer = headerCellWidth - firstPart.Length - secondPart.Length
Dim spaces As String = New String(" "c, spacesCount)
output = firstPart & spaces & secondPart
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
Return output
End Function
End Class