File download Application not Working

I have created the excel file which has some data's extracted from data base.
When i try to write code to download the file it is returning empty xls file.
the code is.
response.setContentType("application/.ods");
response.setHeader("Content-Disposition","inline; filename=" + filepath);
Can any one help me!

Hi,
Use this line at the top of jsp
<%@ page contentType="application/vnd.ms-excel" %>
in jsp, write code to just fetch the data from database and display in table format.
when this jsp is opened, whatever data to be displayed, will be opened in excel file.
example:
<%@ page contentType="application/vnd.ms-excel" %>
<html>
<head>
<title>Export JSP data into Excel</title>
</head>
<body>
<table >
<tr><th colspan="8"><b>Title of Table</b></th></tr>
<tr>
<th>Heading1</th>
<th>Heading2</th>
<th>Heading3</th>
<th>Heading4</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
<td>D</td>
</tr>
<tr>
<td>JSP</td>
<td>JDBC</td>
<td>JSF</td>
<td>JSTL</td>
</tr>
</table>
</body>
</html>

Similar Messages

  • Website image and zip file download links not working in Dreamweaver Air application

    Hi
    I have successfully created and AIR app for an existing business website using the Dreamweaver AIR Extension. The site works very well in all respects except for the part where we have high resolution images and zip files available for download. The download links refuse to do anything, and right-click (PC) / ctl-click (Mac) does nto work either.
    I suspect this may be an AIR sandbox/security issue but am I correct and what can I do to fix it?
    Thanks in advance for any assistance you may be able to give.
    Martin

    I am now facing the same problem. I wrote a servlet .
    code like this
             response = (HttpServletResponse) faces.getExternalContext().getResponse();
             response.setContentType("application/x-download");
             String agent = request.getHeader("USER-AGENT");
             boolean isIE=false;            
            if (null != agent && agent.indexOf("MSIE")!=-1) { 
                isIE=true;
            if (isIE) {
                fileName = URLEncoder.encode(fileName, "UTF-8");
            } else {
                fileName = new String(fileName.getBytes("utf-8"), "ISO-8859-1");
            response.setHeader("Content-Disposition","attachment;filename="+fileName);
            ServletOutputStream os = response.getOutputStream();
            byte b[]=new byte[1024];
            int n;
            while((n=in.read(b))!=-1){
                os.write(b,0,n);
           in.close();
           os.close();
    and i open a new window refer to above jsp ,also i set a breakPoint at os.close(),the program has passed through,but nothing happened in the window.
    If i use IE or FF ,the browser will open a small window to allow me select whether open or  save the file.So can anybody give me some advice.Is it because air using webkit engine and the engine does not do this kind of job?
            Thanks.

  • I keep getting the message: "what should firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    I keep getting the message: "what should Firefox do with this file" in Windows XP every time I want to download a file, e.g., adobe, excel, etc. How can this annoying message be deleted? The check box to "open file automatically" does not work!

    cor-el,
    Thanks for your prompt reply. However, the sources you gave do not seem to apply exactly to my situation. I have attached some screenshots that show what the dialogue box looks like for a pdf download, and what my settings in the Apps panel of Options are. You will note in the first screenshot that I have checked the box to handle this file type automatically; however, the next time I try to download a file of that type, the same dialogue box appears looking exactly like the one shown, so checking the "automatic" option appears to do nothing. The files to be downloaded from my Gmail messages are not generic or altered file types - they are shown as pdf, doc, docx, etc. So while your intent was good, your post did not help. Thanks anyway.

  • I bought creative suite cs6 design standard student and teacher edition and the download did not work properly - files appear incomplete/ or damaged - none of the program items work at all. File size for installation seems very small for a product of this

    I bought creative suite cs6 standard student and teacher edition and the download did not work properly - files appear incomplete/ or damaged. File size seems very small for a product of this size. Can you assist with download issue or provision of software ?

    Lalalaladog where did you download CS6 from?  I would recommend downloading the installation files for Creative Suite 6 Design Standard at Download CS6 products

  • We have developed a desktop application using Flash software and published the same for MAC environment. When we double click on the index.app file, the application is working perfectly in Mac 10.6.7 at our office. But if the same index.app file is double

    We have developed a desktop application using Flash software and published the same for MAC environment. When we double click on the index.app file, the application is working perfectly in Mac 10.6.7 at our office. But if the same index.app file is double clicked in Mac 10.6.7 at out clients location, its not opening. For your information the client is able to open this same application by double clicking on index.swf file. The main problem is that client is not able to open the application using index.app file at their office whereas we are able to do so at our office. Can anyone give some suggestions to sort this problem?

    The most common reason is different versions of Flash, or different versions of web browsers used.  Some users may elect to not have Flash installed at all because of the processor overhead of Flash.  If you are going to make an application for a client, check what operating system and browser versions they are using first.  Then determine if a stand alone application is required, or if they have the necessary plugins to run specific browser enhanced code.
    P.S. MAC is an acronym for Media Access Control.  Mac is the shorthand for Macintosh, the operating system and computers made by Apple Inc.

  • CD installation disk download link not working

    I'm trying to download the CD installation disk for the WRT400N.  The disk came with the router
    but the glue on the label got on the disk and makes it almost unreadable.
    Can someone check that link to see why the .iso file is only a couple of bits in size?  Should be @400mb.
    Thanks

    Yes, it can be configured without the disk, I realize that.  This is my first experience with routers and wi-fi, so I would like a better copy of this disk I paid for.  But the link for that download does not work.  I was addressing that.
    The disk I got had a dot of glue from the label on it and while it worked, it took almost half an hour to get it done.
    Part of the disk is unreadable when I tried to copy it, so I want to download the .iso file to create a backup disk.
    That's it!

  • Two part question 1) what happens if you  sign into messages beta on os x lion 10.7.5 after it expired? does the whole application not work or just imessage? 2) does installing messages beta on os x lion 10.7.5  delete ichat?

    Two part question
    1) what happens if you  sign into messages beta on os x lion 10.7.5 after it expired? does the whole application not work or just imessage? can you stil use AIM, jabbar, google talk, or yahoo?  if you open messages beta does it immediately tell you that messages beta expired?
    2) does installing messages beta on os x lion 10.7.5  delete ichat or just transform ichat into messages beta giving the illusion that ichat is deleted?

    Hi,
    It was never completely clear whether it was just hidden or whether Apple ran a download page for iChat 6.
    As the Download for Messages Beta was separate and "Deleted" iChat it would seem it would be another download for iChat 6.
    iMessages will not function as it is only an Account type within Messages and iChat 6 does not have it.
    Therefore messages on the iPhone will not sync to the Mac. (until you get Mountain Lion and Messages in that OS X version).
    Mountain Lion and it's full version of Messages will not sync the iMessages that have happened in between the 14th December 2012  (end date of Messages beta) and the Install of Mountain Lion if you decide on that route.
    8:51 PM      Sunday; May 5, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Hyperlink to file in JSP not working

    I have a JSP page where I am providing a hyperlink to a file on the C: drive as follows
    Try this
    Nothing happens when I click this hyperlink.
    When I scroll over the hyperlink I see the correct path "file:///C:/ReqImport/data.txt" in the status bar and when paste this path in my address bar, it does open up the file.
    Any ideas why this file hyperlink does not work on this JSP page.
    Thanks

    Hmm, you're right, I just tried it and it doesn't appear to work. It looks like a security thing: If the original page is on my hard drive, links to other files on my hard drive work. But when the original page is on a web server, links to files on my hard drive don't appear to work.
    Do you realize that such a link is referring to a file on the C: drive of the client, the user, not the C: drive of the server? I'm not sure what you're up to, but for most applications such a link is pretty much useless, as you normally have no way of knowing what files the user has on his C: drive.

  • File sharing is not working from pc to imac os x 10.9.2

    file sharing is not working from pc to imac os x 10.9.2

    Hello there Karen,
    It sounds like you are having to power cycle your modem to get internet back every single day. We can start by troubleshooting your Airport Express to help isolate the issue. I would first perform a Soft Reset, then test the issue again. If needed as a last resort I would then perform a Hard Reset:
    Soft reset
    Connect the device to power and wait for it to complete its start up process. To learn more about the start up process, please see All about Wi-Fi base station Status Lights (LED).
    Press and hold the reset button with a pen, pencil, or straightened paperclip for 1 full second, then release it. The light (LED) will begin flashing amber, indicating that the device is in soft reset mode.
    From the AirPort menu bar item, choose the network created by the device (the network name does not change).
    Open AirPort Utility from Applications > Utilities.
    Select the base station, then click Edit (The Edit window will indicate that the base station is in Soft Reset mode).
    Move through the tabs to make changes to your passwords or other settings as needed, and click Update and Continue as required
    Quit AirPort Utility.
    Hard reset
    Press and hold the reset button with a pen, pencil, or straightened paperclip until you see the status light (LED) start to flash amber rapidly, which should occur after about five seconds.
    Release the button and the device will reset.
    Wait about a minute for the base station to finish restarting, then open AirPort Utility from Applications > Utilities.
    Select the base station from Other Wi-Fi Devices, then click Edit.
    Select the Other Options button.
    Select "Restore previous settings" and click Next until you get to the final window.
    AirPort Utility will indicate that Setup is complete. Click Done.
    Quit AirPort Utility.
    Resetting an AirPort base station FAQ
    http://support.apple.com/kb/ht3728
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • Verizon Access Manager Download link not working

    Hi,
              Verizon Access Manager Download link not working, Following Links
    http://www.vzam.net/download/download.aspx?productid=872
    http://pcdn2-download.vzw.com/win/7.7/VZAM_7.7.1_2727b-AC30-Web.exe
    plz help to download verizon five spot access manager.
    thanks
    karthirocks

        Hi karthirocks! I'm sorry to see you're having any difficulties using these links. I've clicked on both, but had no problems getting pages to launch or in getting the application to download. If this is still a problem for you, please describe the issue you're experiencing. Also, please share the browser version you're using, and if you've enabled any security feature that prevents access to certain secure sites or services. Thanks!
    DionM_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • I can't update or Re install the new Firefox on my win 8.1 system. The setup up that downloaded is not working, why?

    The setup up that downloaded is not working.

    If the file has "stub" in the name, it needs to connect back to the server for additional files. Some firewalls block that. Try installing the full installer from the following page (scroll down for your preferred language):
    https://www.mozilla.org/firefox/all/
    Any luck?

  • The photoshop program I downloaded did not work, so I uninstalled it and now I can't redownload it

    The photoshop program I downloaded did not work, so I uninstalled it and now I can't redownload it

    Ttuetken please see CC desktop lists applications as "Up to Date" when not installed - http://helpx.adobe.com/creative-cloud/kb/aam-lists-removed-apps-date.html for information on how to reinstall Photoshop CC.

  • The display the progress of ongoing downloads is not working on firefox

    The balls are rotating, I go to save the file but for some reason, the download display arrow wont light up and the file wont save.
    Here's an example. I went to this video on you tube.
    As I click on the download helper all the files are there.
    Yet when I go to save the file (into my download folder, normal the green arrow would light up and the file would download.) nothing happens anymore. The download progress section is empty and the arrow is grey.
    Posted February 28th, 2015, 8:01 pm
    I'm having the EXACT same problem! Even the (1) or (2) or (3) is shown. But nothing is downloading. Problem started about 24 hours ago.

    the display the progress of ongoing downloads is not working on firefox
    The balls are rotating, I go to save the file but for some reason, the download display arrow wont light up and the file wont save. Here's an example. I went to this video on you tube. As I click on the download helper all the files are there. Yet when I go to save the file (into my download folder, normal the green arrow would light up and the file would download.) nothing happens anymore. The download progress section is empty and the arrow is grey.

  • Application not working without restart the blackberry

    Dear All, when i get connected through WiFi , the only app working is the browser and the reset of the applications not working , and after restarting the blackberry phone every thing working fine for just 24 hours then it come back down again and i need to restart again , so could any one help

    mohammedzico1 wrote:
    the only app working is the browser and the reset of the applications not working , a
    Specifically, what other applications are not working? Name them.
    Do you have a BlackBerry Data Plan enabled on your account with your carrier or mobile provider? You must, in order to get the RIM push email functions you are looking for, as well as additional BlackBerry data services such as the internet browser, Facebook for BlackBerry, BlackBerry Messenger, and much more.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • RealPlayer download feature not working in Firefox (but works in IE)

    Realplayer download feature (cursor over a youtube video, "download this video" pops up) has recently quit working for me (I've been using it for months). I've searched knowledge bases and forums extensively and tried all the suggestions., such as rolling back from Flash Player 11.5 to 10.3 (no luck), disabling/enabling RealPlayer Download plugin in Firefox (no luck), etc. The one suggestion I'd like to try but can't is going into RealPlayer preferences and enabling/disabling the "Download and Record" function. I can't because all I have in my preferences is "Recording" and the options have nothing to do with downloading. None of the RealNetworks/RealPlayer support sites are helpful at all...
    However, the download feature works just fine in Internet Explorer

    Realplayer download does not work in Firefox. Someone suggested ant.com as an add-on. That works.
    For youtube I use YTD downloader (a youtube product). It is more reliable for youtube videos.

Maybe you are looking for

  • When debugging, a for loop is not entered even though the number 6 is passed to "N".

    I cannot figure out why a for loop is not entered when I debug it. When debugging a value of 6 is clearly passed to "N", the number of iterations the loop is supposed to execute. So when I debug, execution highlighting just parses right over the loop

  • ITunes opens when I unplug my headphones

    I have a late 2008 15" MacBook Pro running Mountain Lion. I use the headphones that came with my iPhone 4 with my MBP all the time. Every now and then, when I unplug the headphones from my MBP, iTunes will open. It doesn't happen every time, but it h

  • Using ipad 1& component video cable to view hulu on the tv

    Bought component video cables from apple, hooked up to tv & ipad. No video from hulu. Any ideas? Have i exceeded the capability of this?

  • File structure of published folder

    Thanks for your advice.  Now I know I can publish only the changes I make. Should I open the iWeb folder and drag only the changed pages to the server side of the FTP window?  Can I mess up the file structure of the iWeb folder if I don't do this exa

  • Keep Getting Logged Out

    Does anyone know why I am continually logged out of the system when trying to work. I've tried using different browsers but am logged out every2 minutes or so & have to sign back in. Specifically, it logs me out when i switch windows to work with Dre