poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Zalewski <zalew...@optonline.net>
Subject RE: Footer
Date Tue, 30 Dec 2003 06:03:10 GMT
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:thirimon55@yahoo.com]
Sent: Tuesday, December 30, 2003 12:07 AM
To: poi-user@jakarta.apache.org
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: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message