Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
385
Simple ? Q re Forcing Display of Summary in Group By thru Designer
posted
I am currently using code(below) to force the addition of summaries to a wingrid. However, I have a situation where I would simply like to force the display of the summary, as well format for the correct data type, through the designer. Specifically, I want the data to come up to come up in outlook group by format, with the groups closed, but the summary totals showing. Generally speaking I want to display customers grouped by sales representative code(each rep has many customers), and display the total(summary) sales for this and last year(in separate columns) of the group by(to show how much sales the sales representative) has made. The goal being to be able to quickly look at a large number of reps and see how much they have sold, and then expand the data to see that reps actual customers. I have been through the docs, and the properties, and I just can’t seem to get the settings right. Any help would be appreciated.

 

Dim i As Integer

Dim iBand As Integer

For i = 1 To Me.UGMain.DisplayLayout.Bands.Count

iBand = i - 1

For Each t In Me.UGMain.DisplayLayout.Bands(iBand).Columns

'Debug.Print(t.Header.Caption & " " & t.DataType.ToString)

If t.DataType.ToString <> "System.String" And t.DataType.ToString <> "System.DateTime" Then

e.Layout.Bands(iBand).Summaries.Add(t.Header.Caption, SummaryType.Sum, t, SummaryPosition.UseSummaryPositionColumn)

e.Layout.Bands(iBand).Summaries.Item(t.Header.Caption).DisplayFormat =
"{0:$#,##0}"

End If

Next

Next