EasyXLS
http://forum.easyxls.com/

-:
http://forum.easyxls.com/viewtopic.php?f=4&t=55
Page 1 of 1

Author:  ronfrancis [ Fri Aug 03, 2007 1:29 pm ]
Post subject:  -:

I get this exception while writing out an excel file.



java.lang.-: 8000
at EasyXLS.Util.Conversion.ByteConversion.add_cch_rgch_string(SourceFile:1916)
at EasyXLS.BIFF_Records.l.a(SourceFile:125)
at EasyXLS.ExcelDocument.d(SourceFile:18658)
at EasyXLS.ExcelDocument.easy_WriteExcelFile(SourceFile:15745)
at EasyXLS.ExcelDocument.easy_WriteExcelFile(SourceFile:15412)
at Tutorial2.main(Tutorial2.java:91)

The code is attached below-it is a modification of your examples running against an ORACLE database.

ExcelDocument xls = new ExcelDocument();
Connection sqlConnection = createConnection();

ResultSet rs = null;

String query = " select * from ( select row_.*, rownum rownum_ from ( SELECT /*+index ( person INDX_PERSON_LAST_NAME)*/ NVL(last_name,' ')," +
" NVL(first_name,' '), NVL(general_status,' '),NVL(BAND,' ') FROM person where last_name is not null order by last_name ) " +
"row_ where rownum <= 5000) where rownum_ >0";

System.err.println(query);
PreparedStatement stmt = sqlConnection.prepareStatement(query);
/*stmt.setObject(1, new Long(20));
stmt.setObject(2,new Long(10));*/
rs = stmt.executeQuery(query);

// Create an instance of the object used to format the cells.
ExcelAutoFormat xlsAutoFormat = new ExcelAutoFormat();
// Set the style of the header
ExcelStyle xlsHeaderStyle = new ExcelStyle(new Color(144, 238, 144));
xlsHeaderStyle.setFontSize(12);
xlsAutoFormat.setHeaderRowStyle(xlsHeaderStyle);
long start = System.currentTimeMillis();
System.out.println("Writing file C:\\Trash\\Tutorial2.xls.");

xls.easy_addWorksheet("SourceData");
ExcelTable xlsTable1 = ((ExcelWorksheet)xls.easy_getSheet("SourceData")).easy_getExcelTable();
xlsTable1.easy_getCell(0, 0).setValue("Show Date");
xlsTable1.easy_getCell(0, 1).setValue("Available Places");
xlsTable1.easy_getCell(0, 2).setValue("Available -");
xlsTable1.easy_getCell(0, 3).setValue("BAND");

int row =1;
while(rs.next()){
xlsTable1.easy_getCell(row,0).setValue(rs.getObject(1).toString());
xlsTable1.easy_getCell(row,1).setValue(rs.getObject(2).toString());
xlsTable1.easy_getCell(row,2).setValue(rs.getObject(3).toString());
xlsTable1.easy_getCell(row,3).setValue(rs.getObject(4).toString());

row++;
}

// Generate the file
xls.easy_WriteExcelFile("c:\\Trash\\Tutorial2.xls");

//xls.easy_WriteExcelFile_FromResultSet("c:\\Trash\\Tutorial2.xls", rs, xlsAutoFormat, "Sheet1");

// Confirm generation
if (xls.easy_getError() == "")
System.out.println("File successfully created."+(System.currentTimeMillis()-start)/1000 + " secs");
else
System.out.println("Error encountered: " + xls.easy_getError());

// Close the database connection.
sqlConnection.close();

// Dispose memory
xls.Dispose();
} catch (Exception ex) {
ex.printStackTrace();
if(ex.getCause()!=null) {
ex.getCause().printStackTrace();
}
}

Author:  daniela [ Mon Aug 06, 2007 2:34 am ]
Post subject: 

The defect occurred for EasyXLS version 6.0 and was fixed in version 6.1. If you purchased a Professional or Writer version, you can request a patch. If you are using a trial, EasyXLS Trial 6.1 will be released in a couple of weeks.

Page 1 of 1 All times are UTC - 4 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/