function handleIFRAME(thestring){
var iframe = document.getElementById('reportgen');
iframe.src = 'reportgen.php?'+thestring;
iframe.reload(true);
}
<a href="#" onClick="handleIFRAME('reportid=5&somethingelse=2&etc=10 );">My Link</a>
--------------------------------------------------------------------------------------------
<html>
<head>
<script type="text/javascript">
function twoframes(){
document.getElementById("frame1").src="http://www.java2s.com"
document.getElementById("frame2").src="http://www.java2s.com"
}
</script>
</head>
<body>
<iframe src="http://www.java2s.com" id="frame1"></iframe>
<iframe src="http://www.java2s.com" id="frame2"></iframe>
<br>
<form>
<input type="button" onclick="twoframes()" value="Change url of the two iframes">
</form>
</body>
</html>