Static Header in a Report

  • Is there a way to keep the table header frozen in place similar to the freeze frames in Excel so that a user scrolling through a long report doesn't have to try to remember what each column represents?

  • You would need to custom code the (default) HTML output to either display the results in a different frame, or a scrolling table. But I don't think reporting services can do this.

    Why not export it to Excel and then freeze the frames as you mentioned ?

    Julian Kuiters

  • If it were only for me, the Excel solution is exactly what I would do.  I'm trying to make an internal customer happy, however, so I'm searching out alternatives.  Thanks for the input, though I'm not sure by the answer if you mean that Report Services can't do this without having the custom code created or if this is otherwise possible, but Report Services can't do this.  Would you mind clarifying that point?


  • Sir:

    What you seek is do-able, but it takes some hoop jumping in HTML.  Basically, you use a DIV tag to build a duplicate header row that is only 1 pixel high.  The really hard part is keeping the column widths lined up.  I have included some code snippets from a page of mine that is doing what you are wanting.  Sorry that I cannot show you the page directly as it is on a military server behind numerous firewalls.  This code is a bit jumbled and may be hard to read, so I offer my apologies in advance.

    <form name="Mainform">

    <table id="MainTable" border="0" bordercolor="#FFFFFF" align="center" cellpadding=1 cellspacing=1>

     <tr bordercolor="#000000" bgcolor="#FF9933">

      <th align="center" colspan=1 valign=bottom width="120"><a href="lt004_data1.asp?SO=NSN&Cat=<%=save_cat%>&IM=<%=Request.Form("selIMS")%>&BR=<%=Request.Form("selBranch")%>"><font face="Arial" size=2 color="#000000"><b>NSN</b></a></font></th>

      <th align="center" colspan=2 valign=bottom width="210"><a href="lt004_data1.asp?SO=Noun&Cat=<%=save_cat%>&IM=<%=Request.Form("selIMS")%>&BR=<%=Request.Form("selBranch")%>"><font face="Arial" size=2 color="#000000"><b>Noun</b></a></font></th></tr>


      <td><img src="pixel.gif" width="120" height="1"></td>

      <td><img src="pixel.gif" width="210" height="1"></td></tr>


    <DIV id=oMTData style="OVERFLOW-X: hidden; OVERFLOW: auto; HEIGHT: 268px">

    <table id="MainTable2" border="0" bordercolor="#FFFFFF" align="center" cellpadding=1 cellspacing=1 width="10%">


      <td><img src="pixel.gif" width="120" height="1"></td>

      <td><img src="pixel.gif" width="210" height="1"></td></tr>

      <tr><td align="left" colspan=36 bgcolor="#FFFFFF" height=20><font face="Arial" size=2>Total entries displayed: <%=all_cnt%></font></td></tr>


    The real trick to making this work is the OMTData Div tag with the overflow options being set the way that they are.


    I also want to give credit where it is due.  A good friend of mine - Kyle Lord - helped me to make this work.

    Good luck to you and hope it works out for you.


  • Thanks.  I have an AKO account (Major, US Army Reserve), so if your report is on a public military site (ie one available to the general military public) I would be able to see it.

    I will look over your code.  No need to apologize for the appearance.  Thanks again.

  • No sir, it is not on a public site.  It is on a .mil site.  I am not familiar with an AKO account, but if you can access .mil locations via https, then you can access.

  • An AKO account is an army mail/access account, and so yes, I can access https// addresses.

  • Please respond to me at

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply