× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am using Scott's HSSFR4 and HSSF_H code to create spreadsheets.
I am bringing in a template with the hssf_open and getSheet, which works
great, but when I try to rename the sheet, using setSheetName, it fails
with the following error;

FATAL ERROR in native method: native code passed a wrong class to a static
method


Here is the relevant source;

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* HSSFWorkbook_setSheetName():
* set the name of a sheet in the workbook
*
* sheet = ordinal number that specifies the sheet to rename
* name = new name of sheet
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D HSSFWorkbook_setSheetName...
D PR EXTPROC(*JAVA
D :'org.apache.poi.hssf.usermodel-
D .HSSFWorkbook'
D :'setSheetName')
D sheet like(jint) value
D name like(jString)




d Sheet s like(HSSFSheet)
d sheetnbr s like(jint)
d NewName s like(jString)



// create space for 100 or more object references in the object
group
hssf_begin_object_group(100);

book = hssf_open('/Excel/clm416.xlt');
CreateCellStyles();
Sheet = hssf_getSheet(book: 'Sheet 1');
NewName = new_String(%trim(Excess));
sheetnbr = *zero;
HSSFWorkbook_setSheetName(Sheet: sheetnbr: NewName);
FormatColumns(sheet);

We are still on V5R2.

I don't have a lot of Java experience, so I don't understand this error.
Can anyone tell me what this means and how to fix this?

Gene

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.