Thursday, 28 November 2013

Classic report - Fixed headers and columns

 When we have reports with number of columns and rows, then viewing that report is difficult to the users.
There, we can use fixed headers and columns to view the report easily with horizontal and vertical scroll bars.


Thanks to Jari for his great article.

1. Create a report with static ID (Ex:EMP)

2. Add the below function to your page attributes - Function and global value declaration






<style>#report_#REGION_STATIC_ID# table *{white-space:nowrap!important}</style>
<table cellpadding="0" border="0" cellspacing="0" summary="" #REPORT_ATTRIBUTES# id="report_#REGION_STATIC_ID#">#TOP_PAGINATION#
<tr><td><div id="lh_#REGION_STATIC_ID#">
</tr>

After rows

</table></div><div class="CVS">#EXTERNAL_LINK##CSV_LINK#</div></td></tr>
#PAGINATION#
</table>

Next page template

<a href="#LINK#" class="pagination">#PAGINATION_NEXT#<img src="#IMAGE_PREFIX#themes/theme_1/paginate_next.gif" alt="Next"></a>

Previous page template

<a href="#LINK#" class="pagination"><img src="#IMAGE_PREFIX#themes/theme_1/paginate_prev.gif" alt="Previous">#PAGINATION_PREVIOUS#</a>

Next set template 

<a href="#LINK#" class="pagination">#PAGINATION_NEXT_SET#<img src="#IMAGE_PREFIX#themes/theme_1/paginate_next.gif" alt="Next"></a>

Previous template

<a href="#LINK#" class="pagination"><img src="#IMAGE_PREFIX#themes/theme_1/paginate_prev.gif" alt="Previous">#PAGINATION_PREVIOUS_SET#</a> 






1 comment:

Anil Potu said...

Hi,
i just tried the above method
it is working fine but the only problem i see is the column headings are not exactly mapped, they are not exactly above the column data . the column headings are shorter and data is longer hence not looking properly
does any one know

how this exactly works

(function($){$.fn.htmldbDscroll=function(opt){
opt=$.extend({
width:624,
height:450,
freezeColumns:1,
freezeRows:1,
addCellWidth:1,
addRowHeight:1,
addTblWidth:1,
scrollWidth:1
},opt);