how to put data to excel sheet in jsp?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shepard
    New Member
    • Feb 2013
    • 24

    how to put data to excel sheet in jsp?

    I am creating an application which maps the consumers data usage..
    When I enter counsumer no. it gives me his usage details(time,da y,duration,data usage,etc...)
    in two separate sections as A)night unlimited and B)Day usage...

    It gives me both the data from database....

    Now there is a button below (create excel sheet)..
    On clicking it it should create an excel sheet of data in the night unlimited and Day usage simultaneously. .
    How to do that???

    Should I again take data out from database and give it to create excel or can you just print rows and cloumns from the page which gives consumer details....
  • Nepomuk
    Recognized Expert Specialist
    • Aug 2007
    • 3111

    #2
    Hi!

    I'm not sure I understand your question correctly; what is the difference between the two alternatives?
    One resource that may be helpful to you is the Apache POI project, which will allow you to write Excel files from Java and should in some form work from JSP. Not having used it myself though, I don't know the specifics.

    Comment

    • Shepard
      New Member
      • Feb 2013
      • 24

      #3
      I want to take out each row and column displayed on the page and put it to excel sheet the way I want it.

      How can i do that?

      Comment

      • Nepomuk
        Recognized Expert Specialist
        • Aug 2007
        • 3111

        #4
        The APIs you will probably want to use there are HSSF or XSSF from the Apache POI project. You'll probably end up having a for loop with which you take every row from the JSP and call a POI command to put it into the Excel spreadsheet. Maybe there's a shortcut, without having used POI I can't say for sure. But if you follow that link, you should hopefully find all the information you need.

        Comment

        Working...