Passing Values & Calculating on a Web Part Page RRS feed

  • Question

  • Could anyone suggest any ways to perform a calculation on a web part page to take a beginning balance pulled from a SharePoint list + list items from another SharePoint list to arrive at an ending balance that is calculated & displayed on the page? The web part page should look something like this:

    Beginning Balance XXX (from a SP list)
      List Item 1 XX (these list items
      List Item 2 XX are from another
      List Item 3 XX SharePoint list)
    Ending Balance XXX (this is calculated)

    Basically I am trying to figure out how to take the beg. bal. number from the first list, add the items in the second list, then calculate & display an ending balance on the web part page. I think of these web parts as "containers" and need to pass values from the container to the page.  I know there are web part connections, but I don't really see a way to use them for this purpose. 

    If this was a regular ASP page I would query the database, perform calculations in my ASP code, then just response.write the number in my HTML output.

    I'm just not sure how to pass the data between the web parts and perform the calculation.

    System: MOSS 2007. No access to server for coding. No access to Central Admin. I do have access to SharePoint Designer and full administrative rights to the SharePoint site.

    Maybe DVWP?

    Thanks in advance!!
    Tuesday, October 20, 2009 11:35 PM


  • You might try using a Data View Web Part and using a technique called Merging Connections.  This allows you to join two or more data sources into one Data View. You could then perform your summations within this data view, assuming you could figure out some way to merge these.

    Here's an article discussing the advanced gymnastics you can do with the DVWP, including Merging Connections.
    Tuesday, October 20, 2009 11:56 PM