FIX: Removing Header Row from DhTable Results in Footer on Top

ID: Q197566


The information in this article applies to:


SYMPTOMS

If you call dhTable.setHeaderRow(null) when the DhTable contains both a header and footer, the footer appears in the header position.


CAUSE

When you remove a header row, the <THEAD> table header tag remains in the document. If a footer row is present, it is treated as a header row because the <THEAD> tag remains in the code.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

Q194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

Q194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed


MORE INFORMATION

Steps to Reproduce Behavior

  1. In Visual J++, select New Project from the File menu.


  2. In the New Project dialog box, click the New tab.


  3. In the Visual J++ Projects tree, click Web Pages.


  4. Click Code-Behind HTML.


  5. Click Open to create the project.


  6. Modify Class1.java as follows:
    
       import com.ms.wfc.html.*;
       import com.ms.wfc.core.*;
       import com.ms.wfc.ui.*;
       public class Class1 extends DhDocument
       {
          public Class1()
          {
             initForm();
          }
          private void initForm()
          {
          }
          protected void onDocumentLoad(Object sender, Event e)
          {
             add(new DhHorizontalRule());
             DhTable table=new DhTable();
             add(table);
             table.add(createRow("RowA"));
             table.add(createRow("RowB"));
             table.add(createRow("RowC"));
             DhRow header=createRow("Header");
             DhRow footer=createRow("Footer");
             table.setHeaderRow(header);
             table.setFooterRow(footer);
             table.setHeaderRow(null);
          }
          protected DhRow createRow(String name) {
             DhRow row = new DhRow();
             for (int i=0;i<5;i++) {
                DhCell cell=new DhCell(name+i);
                row.add(cell);
             }
             return row;
          }
       }  


  7. Modify Page1.html as follows:
    
       <HTML>
       <BODY>
       <hr>
       <OBJECT classid="java:com.ms.wfc.html.DhModule"
            height=0 width=0 ... VIEWASTEXT>
       <PARAM NAME=__CODECLASS VALUE=Class1>
       <PARAM NAME=CABBASE VALUE=Project1.CAB>
       </OBJECT>
       <!-- Insert HTML here -->
       </BODY>
       </HTML> 


  8. Run the project.


RESULT: The following Web page appears:
Footer0 Footer1 Footer2 Footer3 Footer4 RowA0 RowA1 RowA2 RowA3 RowA4 RowB0 RowB1 RowB2 RowB3 RowB4 RowC0 RowC1 RowC2 RowC3 RowC4
EXPECTED RESULT:
RowA0 RowA1 RowA2 RowA3 RowA4 RowB0 RowB1 RowB2 RowB3 RowB4 RowC0 RowC1 RowC2 RowC3 RowC4 Footer0 Footer1 Footer2 Footer3 Footer4


REFERENCES

For the latest Knowledge Base articles and other support information on Visual J++ and the SDK for Java, please see the following pages on the Microsoft Technical Support site:

http://support.microsoft.com/support/visualj/

http://support.microsoft.com/support/java/

© Microsoft Corporation 1998, All Rights Reserved.
Contributions by Derek Jamison, Microsoft Corporation

Additional query words:


Keywords          : kbservicepack kbJava kbVJ600bug kbVS600sp2 kbVS600SP1 kbVS600sp3fix kbInetDev kbwfchtml 
Version           : WINDOWS:3.1,6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: May 19, 1999