Pivot reporting framework

you may have missed this todo?