Showing the Data and exporting to Excel Sheet!!!

I've one jsp page displaying the data from the database using jdbc connection. Now, i want to export all these data to the Excel Sheet. Could anyone tell me that , how to achieve this in JSP.
in advance thanks....

please go through the following links
1)http://jakarta.apache.org/poi/
2)http://www.rgagnon.com/javadetails/java-0516.html

Similar Messages

  • How to export the data from table to excel sheet

    hi experts i have some problem am trying to export the data fro table to Excel sheet  in the view controller i have created one button wit public void onActionCLEAR(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionCLEAR(ServerEvent)
       //wdContext.nodeBapi_Salesorder_Getlist_Input().
       //wdContext.nodeBapi_Salesorder_Getlist_Input().invalidate();
        //@@end
      //@@begin javadoc:onActionExporToExcel(ServerEvent)
      /** Declared validating event handler. */
      //@@end
      public void onActionExporToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionExporToExcel(ServerEvent)
         try{
         FileOutputStream fos=new FileOutputStream("Test.xls");
          PrintStream ps=new PrintStream(fos);
          ps.println("<html><body><table border=1>");
          int size=wdContext.nodeBapi_Salesorder_Getlist_Input().size();
           Iterator attributes=wdContext.getNodeInfo().iterateAttributes();
           ps.println("<tr>");
           while(attributes.hasNext()){
            ps.println("<th>");
            DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
            ps.println(attrName.getName());
            ps.println("</th>");
           ps.println("</tr>");
          for(int i=0; i<wdContext.nodeBapi_Salesorder_Getlist_Input().size();i++)
            attributes=wdContext.getNodeInfo().iterateAttributes();
            ps.println("<tr>");
            IWDNodeElement ele=wdContext.getElementAt(i);
            while(attributes.hasNext()){
              ps.println("<td>");
              DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
              ps.println(""+ele.getAttributeAsText(attrName.getName()));
              ps.println("</td>");
            ps.println("</tr>");
           ps.println("</table></body></html>");
           ps.flush();
           ps.close();
           fos.close();
          catch(Exception e){
           wdComponentAPI.getMessageManager().reportException(e.getMessage(), false);
          finally{
         //return("Test.xls")  ;
        //@@end
      }h action and i have return the code
    its running sucessfully but am not able to perform the action plz help me

    Hi,
    You shouldn't use DataAttributeInfo as it is an internal object, if I'm correct.
    Use IWDAttributeInfo instead of DataAttributeInfo and it should work
    (See also API doc of IWDNodeInfo.iterateAttributes() at http://help.sap.com/javadocs/nwce/ce711sp02/wdr/com.sap.wdr/com/sap/tc/webdynpro/progmodel/api/IWDNodeInfo.html#iterateAttributes())
    Cheers,
    Robin

  • Can you export the date and user to Excel that appears into a Comments field in a tracking list?

    Hi everyone,
    Can you export the date and user to Excel that appears into a Comments field in a tracking list?
    When i export a tracking list with a Comment field in the Content type, the screen where you enter the data for an item, the Comments field just export the text of the comment into the Excel file.
    In the Comments field appears also, besides the comment text,  the user and date from who and when the comment is added.
    Is there a way to export also the user and the date?
    Thanks
    Wim

    create another comment field that doesn't use 'appending', and through SP Designer change workflow keep
    updating that field with the new comments  (prepend the field with date/username/new comment). Hide the field on all forms, but put it in the view you need to export to Excel.
    Please refer few more links: Hope they will help
    http://www.nothingbutsharepoint.com/2009/04/16/versioning-append-changes-to-existing-text-view-entries-aspx/
    http://sympmarc.com/2011/02/07/showing-all-versions-of-append-changes-to-existing-text-in-a-data-view-web-part-dvwp/comment-page-3/
    https://mossipqueen.wordpress.com/2013/03/06/display-all-appending-field-entries-in-a-single-list-view/
    http://community.office365.com/en-us/f/154/t/278560.aspx
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • How to export the data as integer into excel sheet?

    Hi All,
         I am working on export to excel functionality and using JEXCEL API to create it.  When I export the data to excel sheet, the data are stored in text format in the excel sheet.  If I click on summation button on excel sheet,  it is not summing up the column values since it is stored as the text format. 
    I am writing the following code:
    for(Iterator iter = columnInfos.keySet().iterator(); iter.hasNext();){
    String attributeName = (String)iter.next();
    for(int index = 0; index < dataNode.size(); index++){
    try{
    IWDNodeElement nodeElement = dataNode.getElementAt(index);
    String colVal = nodeElement.getAttributeAsTex(attributeName);
    Label value = new Label(j, index + 1, colVal);
    sheet.addCell(value);
    j++;
    Here colVal is the variable which holds the data in string format.  So I was just trying to convert it into integer format and used Integer.parseInt(colVal).
    But Label keyword accepts only the int,int,string arguments. 
    Is there any other option to change it as integer value while exporting to excel sheet.
    Pls suggest.
    This is very urgent.
    Regards,
    Subashini.

    Hi Gopal,
    Pls refer the following link.
    /people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache
    I have used the same coding which is mentioned in this link. 
    And also I cannot use integer.parseInt(colval)  because new Label()  will accept only the int,int,string as parameters. 
    Here goes my to excel method code which exports the data to excel sheet .
    private FileInputStream toExcel(IWDNode dataNode, Map columnInfos) {
    String fileName = "output.xls";
    IWDCachedWebResource cachedExcelResource = null;
    int i = 0;
    try{
    File f = new File("output.xls");
    WritableWorkbook workbook = Workbook.createWorkbook(f);
    WritableSheet sheet = workbook.createSheet("First Sheet", 0);
    for(Iterator coluinfoitr = columnInfos.keySet().iterator(); coluinfoitr.hasNext();){
    Label label = new Label(i, 0, (String)columnInfos.get(coluinfoitr.next()));
    sheet.addCell(label);
    i++;
    int j = 0;
    for(Iterator iter = columnInfos.keySet().iterator(); iter.hasNext();){
    String attributeName = (String)iter.next();
    for(int index = 0; index < dataNode.size(); index++){
    try{
    IWDNodeElement nodeElement = dataNode.getElementAt(index);
    String colVal = nodeElement.getAttributeAsText(attributeName);
    Label value = new Label(j, index + 1, colVal);
    sheet.addCell(value);
    catch (Exception e){
    wdComponentAPI.getMessageManager().reportException(" Data Retrive Err :" + e.getLocalizedMessage(),false);
    j++;
    workbook.write();
    FileInputStream excelCSVFile = new FileInputStream(f);
    cachedExcelResource = getCachedWebResource(excelCSVFile, fileName, WDWebResourceType.getWebResourceType("xls", "application/ms-excel"));
    wdContext.currentContextElement().setExcelDownload(cachedExcelResource.getURL());
    workbook.close();
    It is exporting the data in text format.  So I am unable to sum up the column values in the excel sheet.
    I need an alternate solution wherein I can export the data in integer format to excel sheet and then sum up the column values by clicking on summation button.
    Hope I am clear now.
    Pls suggest.
    Regards,
    Subashini.

  • CR cut the data when exporting to excel

    Hi all,
    I ve a formula field in crystal report to extract string data from database. Due to some issues, the length of this formula is fixed to display 20 characters. This is ok as the report is exported to excel and excel can display all data no matter this field exceeds 20 characters or not.
    However, after I enable the Top border formula editor (Format Field->Format Editor->Border tab->click the button "X-2" button besides Top"), CR can only export 20 characters for this field and cut the rest data. Anyone can help to check?
    Best regards,
    Grace

    Try service Pack 3 and if that does n ot rtesolve it you can work with a support engineer by purchasing a case:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • How can I show the date and time on the pictures in iMovie

    I am trying to make a slide show.  The date and time the pictures were taken are the important information that I would like to show in the slide show.  However, I cannot find the way to do that in iMovie. 

    I am trying to make a slide show.  The date and time the pictures were taken are the important information that I would like to show in the slide show.  However, I cannot find the way to do that in iMovie. 

  • Uploading the Data into BDC using Excel sheet

    HI Gurus,
    Iam uploading the Data Using Excel sheet.TCode:qp01.
    Upto 3 screens the data is passing in a very fine manner.
    From the fourth screen I'v to enter the Lineitem for a single material.
    Ex: Matnr is PJBRIX.
    For this material upto 3 screens the data is same ,but from the line item data,the PJBRIX has 3 characterstics.
    How can I upload that data.
    Structure:
    Matnr  Group GroupCounter MicCode Method  Lower Upper
    Pjbrix     5         6                  zsr001    zsr001   1       15
    Pjbrix     5         6                  zsr002     zsr003   4       20
    Pjbrix     5         6                  zsr006     zsr0018  2       18
    This is the Structure.
    Pls gv me the advise or Gv me the code asap.
    thanks in advance.

    HI Gurus,
    Iam uploading the Data Using Excel sheet.TCode:qp01.
    Upto 3 screens the data is passing in a very fine manner.
    From the fourth screen I'v to enter the Lineitem for a single material.
    Ex: Matnr is PJBRIX.
    For this material upto 3 screens the data is same ,but from the line item data,the PJBRIX has 3 characterstics.
    How can I upload that data.
    Structure:
    Matnr  Group GroupCounter MicCode Method  Lower Upper
    Pjbrix     5         6                  zsr001    zsr001   1       15
    Pjbrix     5         6                  zsr002     zsr003   4       20
    Pjbrix     5         6                  zsr006     zsr0018  2       18
    This is the Structure.
    Pls gv me the advise or Gv me the code asap.
    thanks in advance.

  • How can I set my "attach file" system to always show the date and offer to resort?

    When I want to attach a file to an email, or save it for that matter, I have to turn on Details instead of List in the View Menu. How can I set Thunderbird to have Details on as my default.
    Thanks!

    For use in the BB, the on-device format must be used...no PC contains the necessary file structure that the BB needs to find on the card in order to use it correctly. If you can no longer read the card via the BB nor the PC, then it's quite likely that your data is already destroyed. But, there are several PC utilities that claim to be able to recover Flash Memory devices such as SD cards...you should perhaps check those out (Zero Sum something or other? Can't recall specifically, but google will be your best friend in your quest.)
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How do you know what the data usage was for and why?  It shows you date and usage but not the reason.

    How can you see what data usage was for on the bill?  It only shows the date and usage but not the reason for the usage.

    You can not see this info on VZW's site. There are apps for smartphones that will break down the info though, but by site or what was downloaded

  • How can i have the date and time show up on my canon vixia hf m50

    Cannot get the date and time to show up onscreen in ANY videos on my new vixia HF M50. Can somebody help me on this?

    Hello Jerrysulew, 
    You can show the date and time using the Captions option.  The process is described below.
    Add a new level of enjoyment to your scenes by decorating them. You can add animated graphics, stamps and even your own freehand drawings. The supplied stylus pen will be especially useful for decorating scenes.
    You can decorate scenes as they are being recorded.
    IMPORTANT
    The screens and settings that appear may differ depending on the model you are using.
    NOTE
    You can open the decoration screen when the LCD panel is stowed with the LCD screen facing away from the camcorder. In such case, make sure [Autostart Decoration] is set to [On].
    Decorating Scenes while Recording
    1. Touch [ 
    2. Touch [Decoration].
    3. The decoration mode screen appears.
    On the decoration screen, there is a canvas where you can draw freely, and a toolbar with tools lined up for creating your drawings.
    Select the tool you want to use from the toolbar, and make drawings on the canvas.
    Icon
    Tool name
    Function
    Pens and Stamps
    Select the type of pen or stamp and its color. You can also save a canvas or load a previously saved canvas.
    Animated Stamps
    Select animated stamps to add to your decoration.
    Captions
    Add the date, date and time, story title* or story theme* as a caption that will be included in the recording.
    Image Mix**
    Choose one of 27 different frames to add onto the canvas. Image mix can be used in combination with the pens, stamps and animated stamps.
    Freeze screen**
    In recording mode: pause the live video. Touch [ 
     again to restore the live video. You can add decorations to and record the frozen image.
    In playback mode: pause the playback. Touch [ 
     ] to resume playing back the scene.
    Minimize toolbar
    Minimize the toolbar to the top of the screen to view almost all of the canvas. Touch [ 
     ] to restore the toolbar.
    * Not available in 
     mode.
    **Not available in 
     mode and for MP4 movies.
    4. Use a tool from the toolbar as explained in the following procedures.
    5. PressYou can add decorations even while recording a scene.
    6. Touch [ 
     ] to exit the decoration screen.
    NOTE
    For AVCHD movies, decorations will appear in the thumbnails of scenes in the [ AVCHD Movies] index screen and gallery. For MP4 movies, decorations will not appear in thumbnails.
    To use [Pens and Stamps]
    1. Touch [ 
    The [Pens and Stamps] screen will appear.
    2. Select the desired pen or stamp from [Tools].
    Select Colors.
    Touch [ 
    Select white or black from [Colors].
    Alternatively, you can touch [ 
     ] and select a color from the displayed colors.
    3. Draw freely on the canvas.
    Touch [ 
     ] > [Clear] > [Yes] to clear the canvas and start again.
    NOTE
    The canvas with decorations can be deleted, saved, and loaded.
    You can save the decorated canvas right after a decorating action.
    If the memory that contains the canvas is initialized, the canvas will be deleted.
    To use [Animated Stamps]
    1. Touch [ 
    2. Touch one of the control buttons.
    3. Touch anywhere on the canvas to place the selected animated stamp. You can also drag some animated stamps to a different location.
    NOTE
    When the [Animated Stamps] tool is used, the date/time will not be displayed or recorded.
    To use [Captions]
    1. Touch [ 
    2. Touch [Date] or [Time].
    When recording a scene using Story Creator, you can also select [Title]
    (the story&&&&&&&&&s title) or [Story Scene] (the story scene category).
    3. Select the desired text settings and touch [ 
    Touch [ 
     ] (white text on dark background), [ 
     ] (white text) or [ 
     ] (black text).
    Touch the caption and drag it to the desired location.
    To use image mix
    1. Touch [ 
     ] to open the [Select Image] screen.
    2. Touch [ON].
    3. Touch [+] or [-] to select a different image mix frame.
    You can touch one of the memory icons at the bottom of the screen to read image mix frames saved on a different memory (When recording on or playing back scenes from a memory card).
    Touch [ 
     ] to mix the selected frame with the live video.
    NOTE
    When [Rec Media for Movies] is set to [ 
     ] (the built-in memory), you will not be able to select image mix frames saved on a memory card (For camcorders that have internal memory only).
    For AVCHD movies, image mix cannot be selected during playback or while converting a scene to standard definition (For camcorders that have internal memory only). Select the image mix during playback pause or before starting the conversion.
    To use freeze screen
    1. Touch [ 
    The control button will change to [ 
     ] and the picture will be frozen.
    Decorate the screen using the other tools in the palette.
    2. Press the
    The decorations created will be recorded with recording scenes that are on pause.
    Press the
    Touch [ 
     ]. The screen will return to normal.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Filters and Export to Excel (BI 7 report in portal)

    Hi all
    We are seeing some interesting behaviour with the data being exported to excel. 
    The steps to create the problem are -
    - run report
    - filter to limit the data,
    - "export to excel"
    When checking data in excel - the full set of data (that is, prior to the filter being applied) has been transfered.
    Could someone please confirm the following -
    1. is this expected behaviour ?
    2. are there any configuration items that need to be done to export only the filtered data as seen on the current report on the screen ?
    3. any other suggestions ?!
    I look forward to hearing from you.
    Kindest regards
    Karen

    with your product version there are little options you have.
    1. Upgrade to the latest SP and patch on XIR2 (SP6, fp6.4) and re-test
    2. Upgrade to current product release.
    3. figure out what has changed and how in the report and reverse those changes.

  • How to hide the Print and Export button in analytics report or tasks pane

    Hi Experts,
    In BIEE 11g,
    How to hide the Print and Export button in analytics report or tasks pane ?
    For example:
    In console,I have created one userA which is belong to BIConsumer GROUP , when I make use of the highest user 'weblogic' to create one simple report, then the userA will login the analytivs to view this report (not dashboard), it will show the print and export as below.So customers do not want to give him the privilege for printing and exporting.
    In addtion, go to catalog->tasks(left corner), it will also show the print and export button. So how to hide or not access these button?
    Note: Maybe it can use the policy for consumer role for implementing this requirement, but I do not know how to modify the policy. Are you facing the problem? Thanks.

    Hi,
    1. Create seperate folder for Reports & Dashobard.
    2. For BI_Consumer (userA) set the catalog permission to view Dashboard Folder only and remove permission on the Report Folder (you can give traverse permission but don't give Open permision).
    3. By this user won't be able to open or run any reports in that folder and the only way he can see the reports is through Dashboard and on dashboard the export and print buttone can be removed very easily.
    Mark helpful if it helps.
    Regards,
    Kashi
    Edited by: K N Yadav on 24 May, 2013 1:51 AM

  • When  Adobe Formscentral retires can we still send the forms to our customers  and recieve data on the response to export to excel

    When  Adobe Formscentral retires can we still send the forms to our customers  and receive data on the response to export to excel?

    Hello,
    Unfortunately, after the retirement of Adobe FormsCentral; you will not able to send and receive responses.
    Please visit the following link for more information:- End of support | Adobe FormsCentral
    Regards,
    Nakul

  • Imported ical from outlook and the date across the top of the weekly view all show the date i imported..

    imported ical from outlook and the date across the top of the weekly view all show the date i imported..

    I'm confused, what does iCal have to do with this, it seems as though you went from Outlook to Entourage, is that correct?

  • I purchaised MPV's Core Numbers '09 101 software online yesterday. The software only shows the toutorial, and I couldn't find the actual spread sheet. I have taken a long time watching the toutorial. Please help me on how I can find the actual program.

    I purchaised MPV's Core Numbers '09 101 software online yesterday. The software only shows the toutorial, and I couldn't find the actual spread sheet. I have taken a long time watching the toutorial. Please help me on how I can find the actual spread sheet to work on. Thank you in advance

    Visit the developer site for help.
    https://www.appomator.com/support/

Maybe you are looking for

  • Is there any way to find out what the Ext Id is that is assigned to CRM records

    Whilst there is a lot of confusion as to when and where you use this field and what is the unique record key for some, I have understood that however what I am wanting to find is excatly what is the external ID that was assigned to the CRM record whe

  • Home sharing not working on iTunes 11.0.2.26

    I recently updated iTunes to 11.0.2.26 on Windows XP and none of my devices are able to home share. In the previous iTunes version I could. I have an iPhone 5 (6.1.3), iPad 4th Gen and Apple TV 3rd Gen. None of them will share. I can log in with no e

  • ITunes won't work, even after reinstall

    Hi, iTunes just bounces once or twice in the dock when I click on it, and refuses to open. It goes back to it's closed state after that, as if I never clicked on it at all. I've trashed it and all of its prefs, reinstalled twice... nothing seems to w

  • Captivate 8 - can't zoom in/out to view content in web browser

    I'm running Captivate 8 on PC Win7-64bit. After publishing a simulation module (Flash SWF) to HTML for viewing in different browsers (Chrome, IE, Firefox), we can't zoom in or out of module like we can in Captivate 5. You'd typically can press CTLT +

  • Remove All Values option in Input Control

    Hello Everyone, I want to remove All Values option coming automatically from Input Control. Please help how to? Regards, Vaishali Wadhwa.