Page 1 of 1

Sum of detail databand where master has filter

Posted: Tue May 07, 2019 2:56 pm
by Tobias
Simple scenario having two data-sources in a master/detail-relation.

What I want is to have a master and a detail databand TWICE on a page, with each master band having a different filter condition. Now I also want a footer for each master band that sums all values from the detail band.

It works with one master+detail band pair, but not with two. I then get an error.

Please see the attached example.

Re: Sum of detail databand where master has filter

Posted: Wed May 08, 2019 9:04 am
by Lech Kulikowski
Hello,

Could you provide more detailed information or a sample which result do you need?

Thank you.

Re: Sum of detail databand where master has filter

Posted: Wed May 08, 2019 9:49 am
by Tobias
See the above example. The data looks like this:

Code: Select all

{
  "Foos": [
    {
      "Id":  1, 
      "Name": "Foo #1",
      "Type": "foo",
      "Values": [
        {
          "ParentId": 1,
          "Name": "Value #1",
          "Amount": 1.00
        },
        {
          "ParentId": 1,
          "Name": "Value #2",
          "Amount": 2.00
        }
      ]
    },
    {
      "Id": 2,
      "Name": "Foo #2",
      "Type": "bar",
      "Values": [
        {
          "ParentId": 2,
          "Name": "Value #1",
          "Amount": 3.00
        },
        {
          "ParentId": 2,
          "Name": "Value #2",
          "Amount": 4.00
        }
      ]
    },
    {
      "Id": 3,
      "Name": "Foo #3",
      "Type": "foo",
      "Values": [
        {
          "ParentId": 3,
          "Name": "Value #1",
          "Amount": 5.00
        },
        {
          "ParentId": 3,
          "Name": "Value #2",
          "Amount": 6.00
        }
      ]
    }
  ]
}
And I would like to see an output like this:

Code: Select all

// "Foos" filterd by "Type == 'foo'"
Foo #1
  Value #1    1.00
  Value #2    2.00
Foo #3
  Value #1    5.00
  Value #2    6.00
===================
             14.00  // <- SUM of above values
			 

// "Foos" filterd by "Type == 'bar'"
Foo #2
  Value #1    3.00
  Value #2    4.00
===================
              7.00 // <- SUM of above values

Re: Sum of detail databand where master has filter

Posted: Wed May 08, 2019 10:37 pm
by Lech Kulikowski
Hello,

Please check the modified report.

Thank you.