Fixes bug 977636 - upsert for reports table

GOALLLLL
After some minddigging I think I get it. It's just the grim and dark side of the upsert pattern that you have list every item like that. The SQL it generates is kinda horrible but at least you've remedies some of that by using a list in python.