Assign a value to a label on a main form based on the sum of a variable on a subform
We have a report containing 1 subreport.
The subreport is assigned the rooms dataset.
i.e each time the room value changes, we have a new instance of the
sub-report.
The subreport itself gives a list of all the inventories within each room.
If there are a number of rooms in a property the page will display an
instance of the subreport for each room.
In the summary of the sub-report we have a sum of the value of each
inventory.
What I want to do, is take the value of this sum in each subreport and add
them to give a total value for the property.
This is to appear on the main form.
Example.
Property Name
Room
inventories value
inventories value
inventories value
sum of (inventories value)
Room
inventories value
inventories value
inventories value
sum of (inventories value)
Room
inventories value
inventories value
inventories value
sum of (inventories value)
sum of (sum of (inventories
value))
The main problem I have is referencing objects that are outside the local
scope of a report.
Any help or direction would be greatly appreciated.
Thanks
Dermot
The subreport is assigned the rooms dataset.
i.e each time the room value changes, we have a new instance of the
sub-report.
The subreport itself gives a list of all the inventories within each room.
If there are a number of rooms in a property the page will display an
instance of the subreport for each room.
In the summary of the sub-report we have a sum of the value of each
inventory.
What I want to do, is take the value of this sum in each subreport and add
them to give a total value for the property.
This is to appear on the main form.
Example.
Property Name
Room
inventories value
inventories value
inventories value
sum of (inventories value)
Room
inventories value
inventories value
inventories value
sum of (inventories value)
Room
inventories value
inventories value
inventories value
sum of (inventories value)
sum of (sum of (inventories
value))
The main problem I have is referencing objects that are outside the local
scope of a report.
Any help or direction would be greatly appreciated.
Thanks
Dermot
This discussion has been closed.
Comments
In order to reference objects outside the scope of a report in RAP, you need
to create a global reference to that object by using the Module section of
the Module View in the Calc tab (I assume you are using RAP). Check out the
following example on how to create these references and update a value in
the main report from a subreport.
http://www.digital-metaphors.com/tips/MDRapRunningTotal.zip
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for that, it worked a treat.
Dermot