This should work fine.

1) The HSSFSheet.getFooter() method exists in 1.5.1, but you really might
have better luck with 2.0. There are many serious bugs fixed in between
1.5.1 and 2.0.

2) Your import statements should work AFAIK. But 'import
org.apache.poi.hssf.usermodel.HSSFWorkbook.*' is incorrect (there is no such
package - HSSFWorkbook is a class).

3) Try compiling something as simple as what you have included below and
work backwards. The code you supplied has many missing pieces (which shows
that you have not yet done this). For instance, 'startRow = 1' s/b 'int
startRow = 1'. Once you get a complete class to fail, you have something
that we can reproduce and therefore help you.

However, I was able to compile the following:

import org.apache.poi.hssf.usermodel.*;

public class TestFooter {

   public TestFooter()
   {
     HSSFWorkbook wb = new HSSFWorkbook();
     HSSFSheet sheet = wb.createSheet("Sheet1");
     int startRow = 1;

     HSSFRow row = sheet.createRow(startRow);

     short startLine = 1;
     String string = "abc";

     short col = 1;
     HSSFCell cell = row.createCell(col);
     cell.setCellValue(string);
     HSSFFooter footer = sheet.getFooter();
   }
}

See if the above compiles in your environment. Note that you don't need all
those import statements (although I don't think including them should hurt).

Mike Zalewski

-----Original Message-----
From: yangontha Maung [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 30, 2003 12:07 AM
To: [EMAIL PROTECTED]
Subject: Footer

Hi,

I am using poi version 1.5.1 on Red Hat Linux 9.0
Java version 1.4.2

The import statements and the errors are as follows:-


import java.io.*;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.usermodel.HSSFWorkbook.*;
import org.apache.poi.hssf.util.*;
import org.apache.poi.hssf.record.*;
import java.sql.*;
import java.util.*;

public class FooterTest
{

  public FooterTest()
  {
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet("Sheet1");
    startRow = 1;

    row = sheet.createRow(startRow);

    short startLine = 1;
    string = "abc";

    HSSFCell cell = row.createCell(col);
    cell.setCellValue(string);
    HSSFFooter footer = sheet.getFooter();

   xxxx
  }

Compilation Error:
{Note: Don't refer to the line number. I extracted the
relevant program lines only.}

FooterTest.java:35: cannot resolve symbol
symbol  : class HSSFFooter
location: class FooterTest
    HSSFFooter footer = sheet.getFooter();
    ^
FooterTest.java:35: cannot resolve symbol
symbol  : method getFooter ()
location: class
org.apache.poi.hssf.usermodel.HSSFSheet
    HSSFFooter footer = sheet.getFooter();
                             ^
2 errors

rgds,



__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to