Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2009
    Posts
    32
    Rep Power
    0

    Default how to read content of .xls file

    hi all
    i am trying to open and display the contents of .xls file in web application can you pls help me in letting me know how can i open the file and display its contents in jsp page so that i can display the contents finally in webpage.

    Thanks

    Kirti

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

    Default

    Google POI and/or Andy Khan's jxl

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

    Default

    thanks for the reply
    this is what i have done till yet can you please tell me now how can i pass this contents on jsp. so that it is visible on webpage .
    try{
    WorkbookSettings ws=new WorkbookSettings();
    Workbook workbook = Workbook.getWorkbook( new File(fileFileName),ws);
    Sheet sheet= workbook.getSheet(0);
    Cell cell[][]=new Cell[10][10];
    for(int i=0;i<10;i++)
    {
    for(int j=0;j<10;j++)
    {
    String st=cell[i][j].getContents();
    System.out.print(s);
    }
    System.out.println();
    }
    }

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

    Default

    Do you know how to put anything onto a JSP page?

    Then, do that rather than printing the values. Find a JSP tutorial to figure out how to use beans and external Java classes (do not do this as a Scriptlet inside the JSP).

  5. #5
    ek4u is offline Member
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

    Default Hide Row column headers through jxl

    Hi,

    Can anyone tell me how to hide the row-column headers of a worksheet in an excel file open through jxl.jar, displayed on a jsp page. This is manually possible by going to
    Tools->options->Row&Column Headers. But I need to do this through code using jxl library.

    Thanks

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

    Default

    Start your own thread, please, don't hijack someone else's.

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

    Default

    yes i know how to display value on jsp but this string will come one by one how can i do it so that it comes as table that i want to know in jsp only

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

    Default

    Do you know the "foreach" JSTL tag? Then, place the values in a list (one entry per row) of lists (one element per column), and use two embedded "foreach" tags. My God, no one ever said that you are only allowed to change a single line or two in that code. Think for yourself a bit.

    Edit: And, of course, you have to place the "table", "tr", and "td" tags yourself, obviously, but I think you needed to be told.

  9. #9
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    giggle++ ;

  10. #10
    ek4u is offline Member
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

    Default

    Can u plz tell me frm where 2 start a new thread....thanks

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

Similar Threads

  1. Saving Console content to a file
    By puk284 in forum Advanced Java
    Replies: 2
    Last Post: 05-07-2009, 05:58 AM
  2. 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
  3. How to Encrypt content of txt file?
    By aRTx in forum New To Java
    Replies: 0
    Last Post: 03-25-2009, 10:26 AM
  4. Replies: 0
    Last Post: 02-11-2009, 09:53 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
  •