Start the buffer before you start outputting content. Also, clean the buffer once you're done with it.
<?php
ob_start();
?>
<html>
<body>
<div>
//some html content
</div>
</body>
</html>
<?php
file_put_contents('./pdfreportresult.html', ob_get_contents());
ob_end_clean();
...