Not able to open excel file in new window any one plese help me as early

Hi all,
I have a imag tag in jsp on click on the image i am submitting the form
1. i have used the below code
HSSFWorkbook wb=viewHelper.getExcel();
response.reset();
ServletOutputStream outs = response.getOutputStream();
     response.setContentType("application/vnd.ms-excel");
     response.addHeader("Pragma", "No-cache");
     response.addHeader("Cache-control", "no-cache");
     response.addDateHeader("Expires",1 );
     wb.write(outs);
     outs.flush();
     outs.close();
     return;
2. I got one dialog box to open ,save,cancel . if i try to open it is openeing in the same window i had made the request. i need it to ask for in which type of application to open. i.e, in excel , notepad,.....
please mail me as soon as possible
[email protected]

I had a similar porblem....
I got some help from...http://www.javaworld.com/javaworld/jw-10-2006/jw-1019-xmlexcel.html?page=1...
This is my code in servlet...
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet spreadSheet = wb.createSheet("Users");
spreadSheet.setColumnWidth((short) 0, (short) (256 * 25));
spreadSheet.setColumnWidth((short) 1, (short) (256 * 25));
// Creating Rows
HSSFRow row = spreadSheet.createRow(0);
HSSFCell cell = row.createCell((short) 1);
cell.setCellValue("Year 2005");
cell = row.createCell((short) 2);
cell.setCellValue("Year 2004");
HSSFRow row1 = spreadSheet.createRow(1);
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);
cellStyle.setBorderTop(HSSFCellStyle.BORDER_MEDIUM);
cellStyle.setBorderLeft(HSSFCellStyle.BORDER_MEDIUM);
cellStyle.setBorderBottom(HSSFCellStyle.BORDER_MEDIUM);
cell = row1.createCell((short) 0);
cell.setCellValue("Revenue ($)");
cell = row1.createCell((short) 1);
cell.setCellValue("25656");
cell = row1.createCell((short) 2);
cell.setCellValue("15457");
FileOutputStream output = new FileOutputStream(new File("/tmp/Users.xls"));
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=Users.xls");
ServletOutputStream out = response.getOutputStream();
wb.write(output);
output.flush();
output.close();
forward = null;
In firefox i get the download dialog box but not able to open in from there,i need to save it and then open. In IE i dont get the dialog box instead the excell open inside the browser......Please help me to open a excel sheet onclick on a link "Export to excel" in jsp......
Thanks in advance...

Similar Messages

  • Problem opening excel file in new window

    Hi,
    I have a JSF application that sends an Excel file back to the user.
    My backing bean has a method that uses POI to generate the excel file and then write it to the servlet response.
    This works fine if I call the method from a command button, but this displays the file in the current browser window, whereas I want to open the file in a new window.
    I added an onclick javascript call to a command button which does a window.open() to open a jsp in a new window. The jsp contains an empty view, as I'm using an on-load phase listener to make the call to my backing bean method which should send the excel file when the file opens.
    However, when the window opens, I get an IE error message saying 'Could not open xxx.faces', and then an excel error message saying 'Could not open xxx.xls. This may be because the file does not exist, or the file is already open etc etc'
    However, I found that if the popup window goes through a servlet (which just forwards to the jsp page) instead of going to the jsp directly, it works like a charm.
    Any ideas or suggestions on how to fix this would be very much appreciated. If I can't fix it I'll just stick with the servlet approach, although it just seems a bit messy.
    (I'm using IE6 SP2, tomcat 5.5 btw)
    Cheers,
    Stuart

    I'm doing a similar thing, but I use commandLink to lauch the window. CommandLink has the "target" attribute that I set to _blank.  As you would expect, that opens up the page in the new window.                                                                                                                                                                                                                                                                                                                                                                                                       

  • Not able to open data file in a rule file

    Hi,
    We have a rule file which has 140 columns. We are trying to add two new columns at the end (i.e. 141 & 142). We have added those columns in input text file and opened that text file in rule file. So automatically two columns are added at the end of rule file. Mapping is done properly. After that we saved that rule file.
    But next time when we opened that rule file and clicked "Open data file" option nothing is happening. We are not able to open data file in that rule file. But that rule file is working fine when we are running it.
    Can you please give any hint why it is not working?
    Thanks.

    Just a thought about your data file -- maybe 142 columns is too much? Yes, I know, if this is loading to a BSO database, and the columns represent a dense dimension, you are super duper efficient, but is the game worth the candle?
    What happens if you drop one of the members? Mark the column as Ignore During Data Load? Several columns? And then you need to add in new ones? KABOOM!
    FWIW, to keep the process as flexible and maintenance free as possible, I make every record one data value if I have any say in the matter. Yes, it is not efficient. But at least I don't get calls at o-dark-thirty telling me my process blew up and I need to fix it right away.
    NB -- I suppose these are two extremes and the right answer is somewhere in middle, but I will note that you likely won't have issues with reading and writing a data load rule with my approach.
    Regards,
    Cameron Lackpour

  • Not able to open PDF files

    Not able to open PDF files. Before I switched to Lion OS, clicking on a pdf would automatically open it in Adobe Reader. Now I either get a black page or I get just the first page of the document but still in Safari. I would like the pdf to open Adobe Reader. I have tried some of the suggestions in other threads such as deleting all PDF items from Library/Internet Plug-Ins. That did not work.

    Hi ,
    Make sure to back up your Mac before messing around with any system files.
    Press and hold COMMAND + TAB to bring up your Mac’s application switcher, then keep tapping the TAB key while still holding down the COMMAND key until the selector lands on Finder. When it does, go ahead and release the COMMAND and TAB keys.
    Click on the Go menu at the top of the screen, select “Go to folder…” then copy and paste this folder “path” into the pop-up window:
    /Library/Internet Plug-ins
    A new folder window will appear, showing a list of all the browser plug-ins installed in Safari—and at the very top (if the list is sorted alphabetically), you should see one or more files labeled “AdobePDFViewer.” Drag the old Adobe plug-ins into the Trash, then quit and restart Safari.
    Try opening a PDF in Safari again—and yes, it should work, using Safari’s own “native” PDF reader.
    Now, want to open PDFs in Safari using a fresh Adobe PDF Viewer plug-in? Try this:
    Visit this page to download and install the latest (and free) version of Adobe Reader.
    Quit and re-launch Safari, then open a PDF file directly in the browser; when you do, the PDF should open using your new Adobe Reader plug-in.

  • I'm not able to open PDF files in Adobe Reader XI.

    I recently updated to Adobe Reader XI and now I can't open any of my PDF documents or PDF e-mail attachments.  When I click on a document I now get a window that asks if I want to allow this file to open.  I click yes and get a monstrousity the likes I've never seen.  It blacks out my screen for a couple seconds and then I get a mixture of my desktop, task bar, and a window wanting to know if I want to open this with Protected Mode disabled.  It only fills 3/4 of the screen, the items all all blown-up in size, and are distorted.  In playing with this I have gotten notes that I have an "Incompatable Application" and "Acrobat failed to connect to a DDS Server".  On occasion I will get an Adobe Reader screen that is completely greyed out with no content in it and after a couple of seconds it goes off.  Other times I got the window about Protected Mode and I've clicked on to disable it but that doesn't work either.  I removed Adobe Reader XI and re-installed Adobe Reader X and I still have the same problem which I did not have before.  I 'm running Windows 7 Professional and have McAfee anti-virus, which I have disbled on one occasion during download and that I still had the same problem.  I went to program files to find the End User License Agreement and try to see if I needed to click on 'Accept" but it tells me the file does not exist.  I even tried using System Restore to take me back to before I did the upgrade to Adobe Reader XI and I still have this problem.  I'm at the end of my knowledge level and because these files are needed in my business I'm only able to operate at about 50%. 

    From: Test Screen Name [email protected]
    Sent: Sunday, August 04, 2013 11:32 AM
    To: gunner0490
    Subject: I'm not able to open PDF files in Adobe Reader XI.
    Re: I'm not able to open PDF files in Adobe Reader XI.
    created by Test Screen Name <http://forums.adobe.com/people/TestScreenName>  in Adobe Reader - View the full discussion <http://forums.adobe.com/message/5565198#5565198

  • Not able to open XML file in the application server..........

    Hi,
    I have downloaded a XML file to the application server.....
    File is created but i am not able to open the file there....
    Plz advice ....how to open it.....
    Regards.

    Use Notepad. Drag and drop in notepad.
    Aman

  • HT3678 If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    Also i have reinstalled the reader9 two  times and tried with reader8 also but in both the cases same problem.
    it would be gr8 help if someone can help.

  • I am not able to open my file! Captivate 5

    I don’t know who else to send this to right now, but I have been working on a project that is DUE.  I am not sure why, but I am not able to open the file.  Please help me are direct me to someone that can.
    Here's the error message received:
    Adobe Captivate could not open, "file name" Ensure that:
    File is not open already
    File is not damaged
    The hard disk has enough space
    Close all windows
    I need this file open asap. 
    And yes...I cleared the Cache

    Hello,
    This is by design: I failed to explain well. The file exists as long as the file is open, sort of protection that it is not changed by someone else. It will disappear when you close the file. But the first error message at your originial question pointed perhaps to the fact that the file was not closed in a normal way, hence the lock file was perhaps still there. If you deleted the lock file you could have opened the file again, it was no longer protected. Hope my explanation is now a bit clear?
    Lilybiri

  • I am not able to open few files from my external hard disc in snow lepord

    i am not able to open few files from my external hard disc in snow lepord

    Need more information. Is there a message when you try to open them?

  • Not able to open XMind files from IE in read only mode

    I have configured my SharePoint Farm to support .xmind file types
    Below are the steps I have done
    1.  
    Added an entry in DOCICON.XML
        <Mapping Key="xmind" Value="xmind_file1.png" EditText="XMind Mapping Software"  OpenControl="SharePoint.OpenDocuments"/>
    2. Added an entry in htmltransinfo.xml
        <Mapping Extension="xmind" AcceptHeader="application/vnd.xmind.workbook" HandlerUrl="" ProgId=""/>
    3. Added a MiME type 'application/vnd.xmind.workbook' in the Inetmgr.
    Now, xmind files are getting detected, but I am not able to open xmind files in read only mode from IE.
    Xmind files are working perfectly from Mozilla, but my client wants the xmind to be working perfectly from IE.
    Need a help on this issue....

    Hi Aries,
       Please find the screenshot below , while I am trying to open the xmind file in read only mode. It is redirecting the user to a blank page...
    Also please find the extract from the fiddler when trying to open it after selecting the read only mode
    GET http://myserver/sites/Team_test_8/Documents/file1.xmind HTTP/1.1
    Accept: text/html, application/xhtml+xml, */*
    Referer:
    http://myserver/sites/Team_test_8/Documents/Forms/AllItems.aspx
    Accept-Language: en-US
    User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
    Accept-Encoding: gzip, deflate
    Host: myserver
    If-Modified-Since: Tue, 22 Apr 2014 06:40:41 GMT
    If-None-Match: "{3243523D-B412-4437-A587-FA02D4C3C763},9"
    Connection: Keep-Alive
    Cookie: WT_FPC=id=125.22.78.82-1203562128.30325182:lv=1398735003583:ss=1398735003583; WSS_KeepSessionAuthenticated={ce7264f1-49e7-4483-9413-eed8c6929dd7}; ASP.NET_SessionId=knrzwvfb03puo1551qwl3lut
    Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==
    HTTP/1.1 401 Unauthorized
    Server: Microsoft-IIS/7.5
    SPRequestGuid: 16c42597-cfa9-4993-a19a-539ae9b5a7ec
    WWW-Authenticate: NTLM TlRMTVNTUAACAAAAEAAQADgAAAAFgomiyxgpfwFl18AAAAAAAAAAAKQApABIAAAABgGxHQAAAA9FAFIASQBDAFMAUwBPAE4AAgAQAEUAUgBJAEMAUwBTAE8ATgABABYARQBTAEUAUwBTAE0AVwAyADQAMgA1AAQAFgBlAHIAaQBjAHMAcwBvAG4ALgBzAGUAAwAuAEUAUwBFAFMAUwBNAFcAMgA0ADIANQAuAGUAcgBpAGMAcwBzAG8AbgAuAHMAZQAFABYAZQByAGkAYwBzAHMAbwBuAC4AcwBlAAcACACy5d2OcGPPAQAAAAA=
    X-Powered-By: ASP.NET
    MicrosoftSharePointTeamServices: 14.0.0.6114
    Date: Tue, 29 Apr 2014 06:02:10 GMT
    Content-Length: 0
    Proxy-Support: Session-Based-Authentication

  • HT1338 why i'm not able to open pdf files? says i need adobe reader, but not sure where to get it.

    why i'm not able to open pdf files? says i need adobe reader, but not sure where to get it.

    Welcome to the Apple Support Communities
    You can use Preview to open PDFs. Right-click a PDF file and go to Open with > Preview

  • Not able to open ppt files

    I'm experiencing problems opening some .ppt files.
    When I try to open that files a window pop-up. The header of the window is: "oracle hyperion smart view for office, fusion edition". In the window is written: "Presentation.SlideShowWindow : Invalid request. Automation rights are not granted.". The result is that I'm not able to open these files from windows explorer. There is no problem to open the files from inside MS office powerpoint (with file/open, ect).
    The strange thing is that these files are not trying to use any smartview feature.
    MS office is MS office professional plus 2010 version 14.0.6029.1000, the OS is Windows 7, smartview version is 11.1.2.2.301.
    Can you help to solve the problem? Thanks

    Is Microsoft installed on default path?
    Regards
    Celvin
    http://www.orahyplabs.com

  • TAfter IOS5 updating I am not able to open media files from embebed in email atachments. Previous to update email System of offered the opción to open trough any media player I had installed, any clue?....

    After IOS5 updating I am not able to open movie files embebed as email atachments. Previous to update email System offered  the option to open the file trough any media player (app)  I had installed , now it tríes to open the file directly with no success, any clue?....

        Hi Rohit ,
    I had copied these .class & .xml files under Myclasses -> oracle.apps.icx and oracle.apps.po and oracle.apps.fnd was same which comes part of the standard OA tutorial.
    I copied same under Myprojects as well.
    you have to decompile the class file into java file and then place it in Myproject directory , also copy all dependency files like BC4J components , and then
    try to run from Jdeveloper .
    Alternatively you can get the entire ICX folder and zip it and add it via library .
    --Keerthi

  • I am not able to open pdf files from any web through Firefox. Internet explorer opens those pdf files

    I am not able to open pdf files from any web when I use FireFox.
    I am able to open pdf files when I use internet explorer.

    For the settings to check, see the [[opening PDF files within Firefox]] article.

  • I received a pdf from someone with an updated reader.  I am not able to open the file or download the update.  ERROR 1932  ????

    I received a pdf from someone with an updated reader.  I am not able to open the file or download the update.  ERROR 1932  ????

    ERROR 1935 SORRY PLEASE HELP I CANNOT OPEN ANY PDF'S ON MY COMPUTER NOW????????????????

Maybe you are looking for