This following customization will optimize the main table width of report in websites that generated by PHP Report Maker. As we have already known, up to PHP Report Maker 6.0.0, the width of main table of the report will not automatically adjusted to the maximum width of your web application. So we will optimize the report width to the maximum width of your web application.
Please note that this customization is related to the following articles:
- Making a Fixed Width Site Using PHP Report Maker 6.0.0.
- Switching Menu from Horizontal to Vertical and Vice Versa Easily Using PHP Report Maker 6.0.0
Warning: You have to implement the customization in both articles above first before doing the customization below.
[hidepost]
-
Open your \Script\rpt-config.php file, and find this code:
// Begin of modification Fixed Width Site, by Masino Sinaga, December 2, 2012 define("MSR_SCROLL_TABLE_WIDTH", 1000, TRUE); // The width size of the scroll table define("MSR_VERTICAL_MENU_WIDTH", 150, TRUE); // Vertical menu width define("MSR_TOTAL_WIDTH", MSR_SCROLL_TABLE_WIDTH + MSR_VERTICAL_MENU_WIDTH + 20, TRUE); // End of modification Fixed Width Site, by Masino Sinaga, December 2, 2012then replace it with the following code:
// Begin of modification Optimizing Main Table Width to Maximum Width of Site, by Masino Sinaga, December 3, 2012 /* // Begin of modification Fixed Width Site, by Masino Sinaga, December 2, 2012 define("MSR_SCROLL_TABLE_WIDTH", 1000, TRUE); // The width size of the scroll table define("MSR_VERTICAL_MENU_WIDTH", 150, TRUE); // Vertical menu width define("MSR_TOTAL_WIDTH", MSR_SCROLL_TABLE_WIDTH + MSR_VERTICAL_MENU_WIDTH + 20, TRUE); // End of modification Fixed Width Site, by Masino Sinaga, December 2, 2012 */ // End of modification Optimizing Main Table Width to Maximum Width of Site, by Masino Sinaga, December 3, 2012 -
Still in that \Script\rpt-config.php file, find again this code:
// General
before that line, please insert the following code:
// Begin of modification Optimizing Main Table Width to Maximum Width of Site, by Masino Sinaga, December 3, 2012 define("MSR_TABLE_WIDTH_STYLE", 1, TRUE); // 1 = Scroll, 2 = Normal, 3 = 100% define("MSR_SCROLL_TABLE_HEIGHT", 350, TRUE); // The height size of the scrolling table define("MSR_SCROLL_TABLE_WIDTH", 990, TRUE); // The width size of the scrolling table define("MSR_VERTICAL_MENU_WIDTH", 150, TRUE); // The width of vertical menu if (MSR_MENU_HORIZONTAL) { define("MSR_TOTAL_WIDTH", MSR_SCROLL_TABLE_WIDTH + 20, TRUE); } else { define("MSR_TOTAL_WIDTH", MSR_SCROLL_TABLE_WIDTH + MSR_VERTICAL_MENU_WIDTH + 20, TRUE); } // End of modification Optimizing Main Table Width to Maximum Width of Site, by Masino Sinaga, December 3, 2012 -
Open your \Script\rpt-phpcommon-table.php file, and find this code:
<table cellspacing="0" class="ewGrid"><tr>
then replace it with the following code:
<?php // Begin of modification Optimizing Main Table Width to Maximum Width of Site, by Masino Sinaga, December 3, 2012 ?> <table cellspacing="0" class="ewGrid" <?php if (MSR_TABLE_WIDTH_STYLE==1) { echo "width=".MSR_SCROLL_TABLE_WIDTH."px"; } elseif (MSR_TABLE_WIDTH_STYLE==3) {echo "width=100%"; } ?>><tr> <?php // End of modification Optimizing Main Table Width to Maximum Width of Site, by Masino Sinaga, December 3, 2012 ?> - Finally, re-generate your script files using PHP Report Maker as always.
[/hidepost]
Leave a Reply
You must be logged in to post a comment.