yrochon Posted August 9, 2011 Share Posted August 9, 2011 Where can I find complete in-depth documentation about writing custom reports? I have amodule where I need to generate reports and, while I can generate text-only reports quite easily, I find myself struggling at how I can customize the graph reports; for example, I need to pass some parameters to the image being generated. Also, is there any way graph reports can display some HTML in the footer? The reports are monthly based and, instead of going back or entering the parameters directly in the URL, I'd like to add a "Previous" and "Next" button (for the graph report). Thanks! 0 Quote Link to comment Share on other sites More sharing options...
yrochon Posted August 9, 2011 Author Share Posted August 9, 2011 Well, unless there is a better option, I hacked a solution : if ($statsonly) { $prevMonth = $month - 1; $nextMonth = $month + 1; echo <<< END_OF_HTML <script type="text/javascript"> $(function() { var img = $('img[src*="reports.php"]'); var src = img.attr('src'); src += "&month={$month}&view={$view}"; img.attr('src', src); $('#monthControls').appendTo(img.parent()).show(); }); </script> <div id="monthControls" style="display:none;"> <table width="100%"><tr> <td style="text-align:left;"><a href="reports.php?graph=graph_asterisk_server_load&sid={$sid}&year={$year}&month={$prevMonth}"><< Previous Month</a></td> <td style="text-align:right;"><a href="reports.php?graph=graph_asterisk_server_load&sid={$sid}&year={$year}&month={$nextMonth}">Next Month >></a></td> </tr></table> </div> END_OF_HTML; return false; } 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.