How to use JExcel API (excel,csv)

Hi,
I have my java application and I want to read an excel file (.xls) using the Jexcel API to convert a part of it into csv format or a xml format (to make after a pdf file with another java library).....
How can I do it? I need only the first steps!!! I don't know where must I start!!
Thanks a lot

to read Excel files using JExcel, look at the docs API first. The code you'll need looks like the following:
Workbook workbook = Workbook.getWorkbook(new File("D:/tmp/source.xls"));
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
Sheet sheet = workbook.getSheet(3);
          int cols = sheet.getColumns();
          int rows = sheet.getRows();
          Cell cell = null;
               for (i = 1; i < rows; i++) {
                    for (i = 1; i < rows; i++) {
                      cell = sheet.getCell(j, i);
                      //System.out.println(cell.getContents());
               }In order to generate PDF after, you can use iText or FOP.
iText doesn't require XML. It uses simply java objects. (http://www.lowagie.com/iText/)
If you want to generate XML file first, so use FOP. It requires XML and XSL files to generate PDF. (http://xmlgraphics.apache.org/fop/)
Personnaly, I used the two tools (iText and FOP). I prefer iText because it simple and can generate complex PDF.
hth

Similar Messages

  • Unable to display double values in Excel sheet using JExcel API

    Hi
    I am writing code to generate report in the form of Excel Sheet using JExcel API.
    Everything is going fine but whenever I want to put some double values in a cell it is only showing 2 decimal places. My problem is "I want to show upto five decimal places".
    Any kind of reply might help me lot.
    Thank U.

    If you enable the submit zero option, it still happens? This is a new feature on the display tabl
    #NumericZero Enhancements
    To display a numeric zero in place of an error message, you can enter #NumericZero in any of the three Replacement text fields. When you use the #NumericZero option:
    · Excel formatting for the cell is retained.
    · All calculations with dependency on the cell will compute correctly and will take the value of this cell as zero.
    · This numeric zero is for display only. When you submit, the zero value is NOT submitted back to the data source.
    You cannot set display strings for cells that contain an invalid member or dimension name (metadata error). Metadata errors produce standard descriptive error messages.
    Errors are prioritized in the following order from highest to lowest. The error message for a higher-priority error takes precedence over that for a lower-priority error.
    1. (Highest) Metadata errors
    2. #No access
    3. #Invalid/Meaningless
    4. #No data\Missing

  • How to use java api for function activity in embed oracle workflow?

    because i can't install standalone oracle workflow successfully.
    pls tell me how to use java api for function activity in embed oracle workflow?
    are there some patch or pulg-in package?
    ths a lot...........

    The Java Function Activity Agent is not certified for Oracle Workflow embedded in Oracle Applications. Installing standalone workflow should be a lot easier than what you have found, although it looks like you did hit a Pentium 4 issue with the Oracle Universal Installer. I suggest you contact Oracle Support or Oracle Consulting for assistance.
    because i can't install standalone oracle workflow successfully.
    pls tell me how to use java api for function activity in embed oracle workflow?
    are there some patch or pulg-in package?
    ths a lot...........

  • Where I can find documentations on how to use MyComponse API ?

    Where I can find documentation on how to use MyComponse API ?
    Any example ?
    Thanks

    not 100% sure at which point the callout to BEFOREPROCESSCOMPOSE is done, but during the process logs phase, the data in the CVR$ tables is copied into the clg$ tables, and the cvr$ table dml flags cleared
    unles the query is very complex/long running why not join the clg$ tables (only have the data that has changed, so smaller than the cvr$ tables, to your base tables for determining if relevant within the MyCompose needCompose method?
    an example from one of our MyCompose classes is
    public int needCompose(Connection conn, String clientid) throws Throwable{
    boolean baseDirty = false;
    Statement st = conn.createStatement();
    String sql = null;
    int rowCount = 0;
    int fetchCount = 0;
    ResultSet rows;
    // log user
    // sql = "INSERT INTO qpub_log (TIMESTMP,message) "
    // + " values (sysdate, '" + clientid + " assd' )";
    // rowCount += st.executeUpdate(sql);
    // need to compose if there are any relevant changes to assessment details FOR
    // TIR / SOLO assessments
    // Inspection history checklists
    // PIJ marking sheets
    // INSSI
    // Risk Assessment)
    // also changes to (in case of underlying alterations causing data to be withdrawn)
    // STATUS_LOGS
    // ROLE_ASSGNTS
    if(this.baseTableDirty("CDB_OWNER", "ASSESSMENT_DETAILS")){
    return oracle.lite.sync.MyCompose.YES;
    if(this.baseTableDirty("CDB_OWNER", "STATUS_LOGS")){
    sql = "SELECT count(clg.context_key) "
    + "FROM CDB_OWNER.ROLE_ASSGNTS rola "
    + " ,CDB_OWNER.USER_ACCOUNTS usra "
    + " ,CDB_OWNER.CLG$STATUS_LOGS clg "
    + "WHERE usra.user_name = '" + clientid + "' "
    + "AND rola.rolat_rol_code IN ('INSPECTOR','COVER_INSP','DELEG_INSP') "
    + "AND rola.context_key_by=to_char(usra.par_id) "
    + "AND rola.context_key_for=clg.context_key "
    + "AND clg.staa_seq_no=47 ";
    rows = st.executeQuery(sql);
    rows.next();
    fetchCount = rows.getInt(1);
    if (fetchCount != 0) {
    sql = "INSERT INTO qpub_log (TIMESTMP,message) "
    + " values (sysdate, '" + clientid + " assd stal" + fetchCount + "' )";
    rowCount += st.executeUpdate(sql);
    return oracle.lite.sync.MyCompose.YES;
    if(this.baseTableDirty("CDB_OWNER", "ROLE_ASSGNTS")){
    sql = "SELECT count(clg.id) "
    + "FROM CDB_OWNER.ROLE_ASSGNTS rola "
    + " ,CDB_OWNER.USER_ACCOUNTS usra "
    + " ,CDB_OWNER.CLG$ROLE_ASSGNTS clg "
    + "WHERE usra.user_name = '" + clientid + "' "
    + "AND rola.rolat_rol_code IN ('INSPECTOR','COVER_INSP','DELEG_INSP') "
    + "AND rola.context_key_by=to_char(usra.par_id) "
    + "AND rola.id=clg.id ";
    rows = st.executeQuery(sql);
    rows.next();
    fetchCount = rows.getInt(1);
    if (fetchCount != 0) {
    sql = "INSERT INTO qpub_log (TIMESTMP,message) "
    + " values (sysdate, '" + clientid + " assd rola" + fetchCount + "' )";
    rowCount += st.executeUpdate(sql);
    return oracle.lite.sync.MyCompose.YES;
    // if no relevant changes do not compose
    return oracle.lite.sync.MyCompose.NO;
    }

  • Somebody Knows how to use Roambi with Excel spreadsheet? I leed the process. Thanks

    Somebody Knows how to use Roambi with Excel spreadsheet? I leed the process for my IPAd

    I don't even know what it is, but have you explored the support available from the developer?  http://www.roambi.com/iphone-videos.html

  • How to Use JExcel

    Hello Everybody,
    Any one please tell me ,how to get JExcel from web.And how to set the path and how can i use the API in my JSP application? I am using XP Proffessional,MS-Office 98.
    Please help me.Thanks in advance.
    with regards,
    vnlsk

    You can found it at: http://www.andykhan.com/jexcelapi/
    Just add the jxl.jar extracted from your download to your Java Project and it will be ok.
    Gael.

  • How to use custom API's

    Hi All,
    In OIM how can i use my own/Custom API"S. Wher do i need to place the Jar/Class files. Like in other Identity Management tools (I only have the experience of SUN) you can place the files under WEB-INF/lib or WEB-INF/classes and then can easily use them, does OIM provides this/similar kind of functionality and how we can use that.

    Hi,
    If you want to use custom API to create adapter then put the jar file in <OIM_Install>/xellerate/Java Task/
    folder and if you want to use them to create task Schedular then put it in <OIM_Install>/xellerate/Schedular/
    regards

  • How to use KM APIs, Can we use them in Standalone J2ee Application

    Hi Experts,
    I got KM APIs.
    I need to use them to access the KM Repository Content.
    I m a newbie in SAP KM.
    Can anyone help me to use KM APIs.
    For Eg:
    com.sapportals.portal.security.usermanagement.IUser user = …
    IResourceContext resourceContext = new ResourceContext(user);
    RID rid = RID.getRID("/etc");
    try {
      IResource resource = ResourceFactory.getInstance()
                           .getResource(rid, resourceContext);
      if( resource != null ) {
        // resource found
        System.out.println("resource " + resource.getRID() + " found");
      } else {
        // resource not found
        System.out.println("resource " + resource.getRID() + " does not exist");
    catch( ResourceException e ) {
      // problem while retrieving the resource
      System.out.println(
                        "exception while trying to get resource " + e.getRID()
                        + ": " + e.getMessage()
    How will i get the IUser populated?
    Can i use KM APIs from a standalone J2EE application?
    Can i Populate IUser in standalone J2EE application's Servlet?
    Please help me out.
    Waiting for reply
    -pankaj

    Hi Prem,
    Can u tell me how to deploy a war file on to the SAP J2EE server?
    I know how to deploy on Tomcat Server, but dont have any experience abt SAP J2EE server.
    Does SAP J2EE server also have some Webapp directory like TOMCAT where we have to put our WAR File?
    Or to Deploy a WAR File in SAP J2EE server is different, if yes then wats the procedure to do that?
    And can i access the KM APIs in SAP J2EE Server?

  • How to use the API for DATE, MONTH  AND YEAR

    I would like to use the java api in .util.calender in the java api to get the date.
    How to implement the API for the "DATE","MONTH","YEAR" which are available provide by java?
    can someone give me in one complete code?

    From the Java Developers Almanac 1.4:
        Calendar cal = new GregorianCalendar();
        // Get the components of the date
        int era = cal.get(Calendar.ERA);               // 0=BC, 1=AD
        int year = cal.get(Calendar.YEAR);             // 2002
        int month = cal.get(Calendar.MONTH);           // 0=Jan, 1=Feb, ...
        int day = cal.get(Calendar.DAY_OF_MONTH);      // 1...
        int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday, ...

  • How to use Catalog API's

    Hi,
    Can someone please point me to some references or sample implementation where Catalog and Search API functionality is used.
    I want to create a stand-alone windows application much like APILocator.exe to index and search a set of PDF files.
    Thanks
    -Sanjai

    Hi Leonard,
    Thanks for the response.
    Yes I have downloaded the SDK. I'm looking for something more detail as to how to use the catalog APIs to index set of PDF's and use it to search ( if its possible )
    Thanks again
    -Sanjai

  • How to use java api while java programming especially using javase and java swing?

    i need help for java api for undo, redo, htmleditorkit,editorkit.
    in my project i have to use java swing for desktop application but, i need help for how to implement and how to retrieve java api.
    please reply with example or code..

    i need help for java api for undo, redo, htmleditorkit,editorkit.
    in my project i have to use java swing for desktop application but, i need help for how to implement and how to retrieve java api.
    please reply with example or code..
    You find examples and code by searching the internet, not by using forums.
    Start with The Java Tutorials - it has trails for the bulk of the Java functionality.
    See the trail 'How to Write an Undoable Edit Listener'
    http://docs.oracle.com/javase/tutorial/uiswing/events/undoableeditlistener.html
    You learn by DOING - not by reading. Actually DO the tutorial example and try to understand WHAT it does and HOW it does it.
    Then search for other tutorial trails that are of interest.

  • How to use of API for Cancel Sales Orders

    Hi....
    I want to use API for Cancel Sales Orders. Plz give me advice how we can cancel orders. I know that there is procedure provide in ORACLE APPs (i.e. OE_ORDER_PUB.process_order). But in this procedure i know the how to create and update sales order, but how to Cancel order with the use of this API.
    Plz send me soultion as soon as possible. ITS VERY VERY URGENT BASE.
    Thanks in Advance.

    Hi all,
    We are importing Sales Orders on 11.5.9 using OE_Order_PUB.Process_Order API .We have supplied most of the mandatory fields and the same data works from the front end. When we use the API it throws a Ora 20001.
    A snapshot of the error message.
    SQL> exec pk_process_object.process_order('1o');
    Message Count is :2
    Message is RA-20001: User in Package OE_Header_Util Procedure Get_Order_Number
    Message is :User-Defined Exception in Package OE_Header_Util Procedure
    Pre_Write_Process
    Return Status is ErrorU
    PL/SQL procedure successfully completed.
    --------------------------------------------------------------------------------------------

  • Help! How to use pay_element_link API

    Hi all,
    I am developing HRMS Interface to transfer employee element data from other system into EBS. And I want to use Pay element Link API to implement the requirement.
    The requirement is:
    1.     Using the primary key of NATIONAL_IDENTIFIER_NUMBER (ssn) check to see if the employee exists as an active employee in Oracle.
    2.     Validate that the Element is a valid element and retrieve the Benefit Type from the DFF (ELEMENT_INFORMATION11). If the element is invalid or does not have a Benefit Type defined, flag the record as ‘REJECTED’ and write the error to the log file and move to next record in staging.
    3.     If the employee has another active element assigned for the same Benefit Type, using the API’s terminate the existing element for that Benefit Type.
    4.     Using the API’s add the new element to the employee with the appropriate element entries.
    5.     Flag the status of the record in staging to ‘PROCESSED’.
    The step1 and step2 is logic adjustment. And I have finished them. Next I will finish 3,4 and 5. The fifth step is easy to approach. I can not do 3 and 4 for I do not konw how to use the pay_element_link_API. And I know the 3 wiil use PAY_ELEMENT_LINK_API.update_element_link, the 4 step will use PAY_ELEMENT_LINK_API.CREATE_ELEMENT_LINK. But the most difficult is I do not konw what to pass the parameter to update_element_link and create_element_link. I do not know the meaning of the two procedure's parameter.
    When the element has many entry values, how to import these entry value into the EBS. For example, an element names 'Retirement Plan' and the element has a input value names 'Amount' and the value is 80$. So I want to know how to import the 80$ into EBS by the API. Just means, the 80$ will pass to which one parameter in the create_element_link or update_element_link.
    Please give me some ideas. Thank you so much

    On troubleshooting the HR api's you can use the pyupip logging mechanism . This would allow you to pinpoint what stored procedure section is being executed when the error ocurred.
    set serveroutput on
    spool trace.log
    begin
    hr_utility.set_trace_options ('TRACE_DEST:DBMS_OUTPUT');
    hr_utility.trace_on;
    -- your code here
    hr_utility.trace_off;
    Exception
    when others then
    dbms_output.put_line(sqlerrm);
    hr_utility.trace_off;
    END;
    spool off

  • How to use BEA API Authorization.getRoles?

    I find a bea api class Authorization.getRoles(P13nResource aResource, P13nContextHandler aRequestContext)
    return Map,I wonder know the P13nResource and P13nContextHandler how to creatre ?
    because I want to use the API to return Map roles,please tell me some information

    this code can get roles map:
    P13nContextHandler ctxHandler = EntitlementHelper.getP13nContextHandler(request);
                   HierarchyRoleResource resource = new HierarchyRoleResource(SecurityHelper.getApplicationName(), webAppName, EntitlementConstants.P13N_ROLE_POLICY_POOL, "");
                   Map map = Authorization.getRoles((P13nResource)resource, ctxHandler);

  • How to use tcRequestOperationsIntf API to create a self-request?

    According to documentation, I can use tcRequestOperationsIntf API methods to create and manage requests.
    How can I use these methods to initiate a self-request (for provisioning user a new resource)?
    Because when I create a usual request, it's equivalent to direct provisioning the resource (from the user's resource profile) then all approval processes are bypassed :(

    While tcUserOperationsIntf.provisionResource would provision the resource to the user bypassing the approval, tcRequestOperationsIntf can be used to raise a request to provision a user with a resource along with approval, if approval is defined for that resource in the approval process.
    Here is a sample code for raising a request to provision user (lUserKey) with resource object (lObjectKey)
    ///Created the request object for provisioning the RO
    requestObj = (tcRequestOperationsIntf) utilFactory.getUtility("Thor.API.Operations.tcRequestOperationsIntf");
    HashMap reqMap = new HashMap();
    reqMap.put("Requests.Target Type", "U");
    reqMap.put("Requests.Object Request Type", "Add");
    reqMap.put("Requests.Type", "U");
    lRequestKey = requestObj.createRequest(reqMap);
    //Adding user to be provisioned for
    requestObj.addRequestUser(lRequestKey, lUserKey);
    //Adding object to be provisioned
    requestObj.addRequestObject(lRequestKey, lObjectKey);
    //create the request
    requestObj.completeRequestCreation(lRequestKey);
    Hope it helps,
    Rgds, Ajay

Maybe you are looking for