× 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.



Darren,
Your main error is saying it can't find the class HSSFtext in your
classpath. The classpath can be a tricky thing some times, but
essentially you just need to make sure your classpath includes the
path to your class, e.g. /home/DARREN/classes/, if that's where you're
class is.

Another note is that you shouldn't use name main like that. In Java
the "static void main" has a signature of main(String[] args). This
will be the method that is invoked if you were to invoke the class
from the command line.

I also see it looks like your second parameter is defined as a short,
but your Java class is expecting an int.

A note on style, no variables should start with a capital letter. The
Row variable should be row. It's not defined in the spec as much as
style, but camel case is the typical naming convention for Java.
Classes or interfaces should really be the only thing that starts with
a capital letter.

Finally, I don't think this will really improve performance as much as
cut down on some of the code you have to write when creating a cell in
RPG. The biggest issue with performance for RPG and Java is that the
JVM will not garbage collect objects created in RPG. You have to do
that via JNI. So you're still creating new objects that won't be GC'ed
each time you invoke this method.

--
James R. Perkins



On Mon, Mar 22, 2010 at 07:07, <darren@xxxxxxxxx> wrote:


I'm still on a quest to improve our Excel document creation performance.
I've created the following java program to perform what Scott Klement's RPG
service program did, to create a text cell, but doing the 4 steps in Java
to hopefully get improved performance.  I'm having problems either
specifying the java header stuff correctly, or in specifying the RPG
prototype, because I get a java.lang.NoClassDefFoundError: HSSFtext error
when calling a program using the prototype.  Can anyone see where I'm going
wrong?

Java program:
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;

public final class HSSFtext {
       public static void main(HSSFRow Row, int Col, String value,
HSSFCellStyle style ) {

       HSSFCell Cell = Row.createCell(Col);
       Cell.setCellType(1);
       //wwStr = new_String(peString);
       Cell.setCellValue(new HSSFRichTextString(value));
       Cell.setCellStyle(style);

       }
}



RPG prototype:
    D hssf_textz...
    D                 PR                  EXTPROC(*JAVA
    D                                     :'HSSFtext'
    D                                     :'main')
    D*  peRow                             like(HSSFRow)
    D   peCol                             like(jshort) value
    D   peString                          like(jstring)
    D   peStyle                           like(HSSFCellStyle)

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.