

'' *C* If I add an extra unbound column in the parent (Bands(0)) with a formula that sums the child column: 'summary = e.Layout.Bands(0).Summaries.Add("GrandTotal_DisplayUSDOutOfRange", SummaryType.Sum, columnToSummarize, SummaryPosition.UseSummaryPositionColumn) 'columnToSummarize = e.Layout.Bands(0).Columns("headers_psparforecastingmonthclose3/displayusdoutofrange") ' I got errors on the variations I tried: this method might work but I just got the format wrong '' *B* This doesn't work, tried referencing the child column but through the parent band using a relative reference 'summary = e.Layout.Bands(0).Summaries.Add("Total_DisplayUSDOutOfRange", SummaryType.Sum, columnToSummarize, SummaryPosition.UseSummaryPositionColumn) 'columnToSummarize = e.Layout.Bands(2).Columns("DisplayUSDOutOfRange") '' *A* This doesn't work, column from band 2 summarized in 0: '' Can't get summary in the parent's grand totals of a column in the child though: Summary = e.Layout.Bands(2).Summaries.Add("TotalUSDOutOfRange", SummaryType.Sum, columnToSummarize, SummaryPosition.UseSummaryPositionColumn) '' Summary in the child of a column in the child works fine tooĬolumnToSummarize = e.Layout.Bands(2).Columns("DisplayUSDOutOfRange") Summary = e.Layout.Bands(0).Summaries.Add("Total_ContractQuantity", SummaryType.Sum, columnToSummarize, SummaryPosition.UseSummaryPositionColumn) '' Summary in the parent of a column in the parent works fineĬolumnToSummarize = e.Layout.Bands(0).Columns("ContractQuantity") If e.Layout.Bands(0).Summaries.Count = 0 Then Private Sub ugrdMain_InitializeLayout(ByVal sender As System.Object, ByVal e As ) Handles ugrdMain.InitializeLayout See the spot I marked with *C*: that is a way that gets the number I want in the Band(0) summary row but like I mentioned doesn't seem like the right way to do it: Is there a way to make the spots marked *A* or *B* work the way I describe? ^ (need this grand total but can't get it to work)īelow is a snippet of what I've been testing with. (I've got 3 datatables, 1 is the parent and the other 2 are children of that, it's one to many between the parent and each child, with the parent in Bands(0), and the children in Bands(1) and Bands(2)) But I can't get the grand total for that child column for all parents.

I can get sub totals for the child column for each individual parent in the island summary: again easy. I can get a total for a column in the parent: easy. I need a grand total at the very bottom of the grid for a number that is in the child rows. While I'm at it, below is graphically what I need in case my original post wasn't clear enough. And before I go doing that method, I wanted to make sure I wasn't missing something. I just worked out a way of getting the sum I want in the Band(0) summary row but like I mention below, it seems like overkill and it has other drawbacks, especially since I need to do this for a lot of columns.

I had tried many different values and combinations of values in the SummaryDisplayArea but none got what I needed. I'm coming back to this again now after trying a couple things after Mike's first reply and not getting it figured out. I've found I can toggle the Band's Hidden property and that doesn't seem cause any problems and it seems fairly quick: If the answer to my question about collapsing is No, are there any problems with toggling the the Hidden property that make it a bad idea? Worst case, I can add textboxes to the form to show a sum from the child datatable but I'd rather not do that.Īnother question that I have related to this same grid is: can I collapse just one of the children? Keep showing the Estimates but collapse the Invoices? Since there is just a + up at the Contract which collapses both children, I'm guessing not. If it's not do-able with what's built into the grid and it's members, can I get there by maybe adding an unbound column to the parent that has a formula that sums it's children and then summarize that parent column? Is it possible to show grandtotals for a child column across all the parents? In my case I need to sum the quantity column for all the Contracts.

In the Estimates child I'm showing a quantity column which gets summed for the lines for that contract and that summary works. I have a hierarchical grid with a parent and 2 children and I have got summaries showing on some fields in one of the children.Įach of them is bound to a datatable in a dataset.
