Results 1 to 8 of 8
  1. #1
    kirtichopra is offline Member
    Join Date
    Sep 2009
    Posts
    6
    Rep Power
    0

    Default how to display content of .xls file in jsp

    hi all
    Please help me with this i am first time doing this and not getting how to do it.
    the following is the action class that i have wrote and i want to do it by passing some object to jsp. please help
    WorkbookSettings ws=new WorkbookSettings();
    Workbook workbook = Workbook.getWorkbook( new File(targetPath),ws);
    Sheet sheet= workbook.getSheet(0);
    for(int i=0;i<sheet.getRows();i++)
    {
    for(int j=0;j<sheet.getColumns();j++)
    {
    Cell cell=sheet.getCell(j,i);
    CellType type=cell.getType();
    if(cell.getType()==CellType.LABEL)
    System.out.print(cell.getContents()+ " ");
    else
    System.out.print(cell.getContents()+" ");

    }
    i am getting the contents in console how to get that on jsp pls help.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Did you get tired of how to read content of .xls file

  3. #3
    kirtichopra is offline Member
    Join Date
    Sep 2009
    Posts
    6
    Rep Power
    0

    Default

    Sir if you want to help then please reply otherwise stop replying
    I really appreciate your advance knowledge but since i am fresher and don't know about it so i want help over it help in the sense a little bit of code or simple references or how should i approach over it..
    Thank you so much for your concern as you are checking my threads please give answer otherwise dont reply i would appreciate that..

  4. #4
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    Please do not double post, it's annoying.
    My Hobby Project: LegacyClone

  5. #5
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by kirtichopra View Post
    Sir if you want to help then please reply otherwise stop replying
    I really appreciate your advance knowledge but since i am fresher and don't know about it so i want help over it help in the sense a little bit of code or simple references or how should i approach over it..
    Thank you so much for your concern as you are checking my threads please give answer otherwise dont reply i would appreciate that..
    I told you in your other thread "how to approach it". Give it a try, and post that code in your other thread, if it does not work and we will help you correct it. We are not, however, going to do it for you.

  6. #6
    Join Date
    Sep 2009
    Posts
    32
    Rep Power
    0

    Default

    Hi all
    for(int i=0;i<sheet.getRows();i++)
    {
    for(int j=0;j<sheet.getColumns();j++)
    {
    Cell cell=sheet.getCell(j,i);
    CellType type=cell.getType();
    if(cell.getType()==CellType.LABEL)
    System.out.print(cell.getContents()+ " ");
    else
    System.out.print(cell.getContents()+" ");

    }
    with this code i have started getting array out of boung exception pls tell me how can i rectify it!!!

  7. #7
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Does getCell take (col, row) as arguments or (row, col)?

    Also, I do hope you realise that the prints are not what you want, which you have already been told in your other thread.

  8. #8
    Join Date
    Sep 2009
    Posts
    32
    Rep Power
    0

    Default

    it is agian giving me array out of bound exception pls help!!!

Similar Threads

  1. how to read content of .xls file
    By kirtichopra2003 in forum Advanced Java
    Replies: 10
    Last Post: 09-11-2009, 01:03 PM
  2. Jtextarea Content Display Problem
    By REVANSIDDHA in forum Advanced Java
    Replies: 1
    Last Post: 03-31-2009, 06:53 PM
  3. Read the content of file from a specified path
    By shiva in forum New To Java
    Replies: 2
    Last Post: 03-26-2009, 07:31 AM
  4. How to Encrypt content of txt file?
    By aRTx in forum New To Java
    Replies: 0
    Last Post: 03-25-2009, 10:26 AM
  5. Replies: 0
    Last Post: 11-07-2008, 01:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •