Opening an excel file in jsp

how do you open an excel file in my jsp and target it to a table?

can't it be done using the file class?
i just want to open the excel file, that's all--
Open means what ?
See if this is useful
String myDB =  "jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=c:/book.xls;"
    + "DriverID=22;READONLY=false";
//con=DriverManager.getConnection("jdbc:odbc:myExcel");
con=DriverManager.getConnection(myDB,"","");
dbmd=con.getMetaData();
stat=con.createStatement();
rs=stat.executeQuery("Select * from `Sheet1$`");//[Sheet1$]--
I think it is not possible with File class. and if it is so
then how you are going to handle the data ?

Similar Messages

  • Open an excel file from jsp

    Hi,
    I want to open an excel file on click of a link in the jsp.
    At present iam using href which i feel is not correct as it is not able to recognize the excel format and paints the entire screen with special characters.Can anyone please help me out.
    Thanks,

    In your server, there should be some way to tell the server the mime type of a file based on the file's extension. So, you tell the server for every file with the extension of .xls, it should use the mime type of application/vnd.ms-excel. Then, when the link is clicked on, the browser will receive the mime-type message of application/vnd.ms-excel and will open Excel to work with the file.
    Hope this helps,
    Ron

  • Excel file in JSP

    can anyone please tell me how to open a excel file in jsp, i have done this by opening excel sheet in html using iframe, tell me soon..

    If you want to serve up an existing excell spreadsheet:
    <%
         response.setHeader("Content-Disposition", "attachment; filename=somefile.xls");
    %>If you want the contents of an html file opened in excell:
    <%@ page
    language="java"
    contentType="application/vnd.ms-excel;"
    pageEncoding="ISO-8859-1"
    %>
    <%
         response.setHeader("Content-Disposition", "attachment; filename=spreadsheet.xls");
    %>
    <html><head></head><body>
    <table>
    <tr>
    <td>cell1</td>
    <td>cell2</td>
    <td>cell3</td>
    </tr>
    ...

  • Opening an Excel File using Excel 97 from a JSP populated page(Urgent)

    Hello,
    I am using a JSP Page to populate data from the DB.
    When I am opening the same as an Excel File the JSP code is coming as the Excel page whenever Excel 97 is being used,but when Excel2000 or 2003 is being used then the data are coming as Excel formatted.I used the following code(JSP) :
    <head>
    <%
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","inline; filename=ExtractData.xls");
    %>
    </head>

    I can't even tell what the difference is between "coming as the Excel page" and "coming as Excel formatted". But then when people make urgent posts they very rarely spend the time to describe the problem accurately. Why bother when it's so damn urgent?

  • Opening multiple excel files thorugh a servlet

    Hi
    In my system , i have excel reports in my server disk . And i am opening the excel files through an servlet class like /viewReport.do?id=23 .....and thus from the servlet will open my excel file .
    After opening one excel file , i try to open another excel by clicking that link , then my system often hangs else excel shows an error saying "a report with name viewReport.do is already open " even though both of these files are different on the server
    How can i avoid this ??
    The reason why i am opening the excel file through a servlet is , i need to perform some operations before opening that excel report
    Can any one let me know how to go abt this ??

    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...
    Message was edited by:
    onlycoding

  • Microsoft Forms and Microsoft Visual Basic while opening the Excel file

    Hello,
    I have issues with 2010 64 bit Office Pro Plus Excel. Whenever I open an Excel file (97-2003 worksheet) which has macros then I get below 2 errors in sequence.
    Please note that all macro settings are enabled and below are my system configs.
    Win 7 Ultimate 64 bit,
    MS Office Pro Plus 2010 64 bit with SP2.
    Googled all and tried but in vein and also note that I dont have any .exd files under ../forms to delete. Please help.
    Please note that for others with same system config/office versions and same 97-2003 worksheet it works so issues is only in my system.
    First Error
    Microsoft Forms
    Could not load an object because it is not available on this machine.
    Second Error
    Microsoft Visual Basic for Applications
    Compile error in hidden module:  MainUtilities2.
    This error commonly occurs when code is incompatible with the version, platform, or architecture of this application.  Click "Help" for information on how to correct this error.
    Thanks.

    Your macro's will not run in a Office 64 environment only in a 32bit environment. The 64bit environment has a whole different setup and macro's created in an earlier 32 bit environment will stop working.
    So if you want to use them in a 64 Office environment you have to rewrite the macro's.
    have a look here:
    http://msdn.microsoft.com/en-us/library/gg264421.aspx
    Maurice

  • After upgrade to 10.9.1 office for mac 2011 will not open most excel files.

    After upgrade to 10.9.1 office for mac will not open most excel files. The files will open in open office. I have tried re-saving as excel file, no joy.
    I have repaired permissions, no joy.
    below are the results of EtreCheck scan.
    Hardware Information:
              MacBook Pro (13-inch, Early 2011)
              MacBook Pro - model: MacBookPro8,1
              1 2.3 GHz Intel Core i5 CPU: 2 cores
              8 GB RAM
    Video Information:
              Intel HD Graphics 3000 - VRAM: 512 MB
    System Software:
              OS X 10.9.1 (13B42) - Uptime: 5 days 3:45:14
    Disk Information:
              Hitachi HTS545032B9A302 disk0 : (320.07 GB)
                        EFI (disk0s1) <not mounted>: 209.7 MB
                        Macintosh HD (disk0s2) / [Startup]: 319.21 GB (64.84 GB free)
                        Recovery HD (disk0s3) <not mounted>: 650 MB
              OPTIARC DVD RW AD-5970H 
    USB Information:
              Apple Inc. FaceTime HD Camera (Built-in)
              Apple Inc. Apple Internal Keyboard / Trackpad
              Apple Inc. BRCM2070 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple Computer, Inc. IR Receiver
    FireWire Information:
    Thunderbolt Information:
              Apple Inc. thunderbolt_bus
    Kernel Extensions:
              org.virtualbox.kext.VBoxDrv          (4.1.2)
              org.virtualbox.kext.VBoxUSB          (4.1.2)
              com.logmein.driver.LogMeInSoundDriver          (1.0.3 - SDK 10.5)
    Startup Items:
              VirtualBox: Path: /Library/StartupItems/VirtualBox
    Launch Daemons:
              [System] com.adobe.fpsaud.plist 3rd-Party support link
              [System] com.logmein.logmeinblanker.plist 3rd-Party support link
              [System] com.logmein.logmeinserver.plist 3rd-Party support link
              [System] com.logmein.raupdate.plist 3rd-Party support link
              [System] com.microsoft.office.licensing.helper.plist 3rd-Party support link
              [System] com.oracle.java.Helper-Tool.plist 3rd-Party support link
              [System] com.sharpcast.xfsmond.plist 3rd-Party support link
              [System] com.teamviewer.teamviewer_service.plist 3rd-Party support link
              [System] com.zeobit.MacKeeper.AntiVirus.plist 3rd-Party support link
              [System] org.macosforge.xquartz.privileged_startx.plist 3rd-Party support link
    Launch Agents:
              [System] com.logmein.LMILaunchAgentFixer.plist 3rd-Party support link
              [System] com.logmein.logmeingui.plist 3rd-Party support link
              [System] com.logmein.logmeinguiagent.plist 3rd-Party support link
              [System] com.logmein.logmeinguiagentatlogin.plist 3rd-Party support link
              [System] com.oracle.java.Java-Updater.plist 3rd-Party support link
              [System] com.teamviewer.teamviewer.plist 3rd-Party support link
              [System] com.teamviewer.teamviewer_desktop.plist 3rd-Party support link
              [System] org.macosforge.xquartz.startx.plist 3rd-Party support link
    User Launch Agents:
              [not loaded] .dat0157.000 (hidden)/Users/fboyd3/Library/Application Support/Spotify/SpotifyWebHelper
              [not loaded] com.adobe.ARM.[...].plist 3rd-Party support link
              [not loaded] com.google.keystone.agent.plist 3rd-Party support link
              [not loaded] com.microsoft.LaunchAgent.SyncServicesAgent.plist 3rd-Party support link
              [not loaded] com.spotify.webhelper.plist 3rd-Party support link
              [not loaded] com.zeobit.MacKeeper.Helper.plist 3rd-Party support link
              [not loaded] org.virtualbox.vboxwebsrv.plist 3rd-Party support link
    User Login Items:
              iTunesHelper
              GrowlHelperApp
              Alarm Clock
              Canon IJ Network Scanner Selector2
              Microsoft Database Daemon
              SugarSync Manager
              Neat
              LogMeIn
              Dropbox
              Spotify
              Spotify
              AdobeResourceSynchronizer
    Internet Plug-ins:
              LogMeInSafari64: Version: 1.0.730 3rd-Party support link
              OVSHelper: Version: 1.0 3rd-Party support link
              Default Browser: Version: 537 - SDK 10.9
              Flip4Mac WMV Plugin: Version: 3.0.0.126   - SDK 10.8 3rd-Party support link
              AmazonMP3DownloaderPlugin101750: Version: AmazonMP3DownloaderPlugin 1.0.17 - SDK 10.4 3rd-Party support link
              AdobePDFViewerNPAPI: Version: 11.0.03 - SDK 10.6 3rd-Party support link
              FlashPlayer-10.6: Version: 12.0.0.70 - SDK 10.6 3rd-Party support link
              DivXBrowserPlugin: Version: 2.1 3rd-Party support link
              LogMeIn: Version: 1.0.730 3rd-Party support link
              Flash Player: Version: 12.0.0.70 - SDK 10.6 3rd-Party support link
              iPhotoPhotocast: Version: 7.0 - SDK 10.8
              LogMeInSafari32: Version: 1.0.730 3rd-Party support link
              QuickTime Plugin: Version: 7.7.3
              AdobePDFViewer: Version: 11.0.03 - SDK 10.6 3rd-Party support link
              SharePointBrowserPlugin: Version: 14.3.4 - SDK 10.6 3rd-Party support link
              Silverlight: Version: 5.1.20125.0 - SDK 10.6 3rd-Party support link
              EPPEX Plugin: Version: 3.0.0.0 3rd-Party support link
              WidevineMediaTransformer: Version: (null) 3rd-Party support link
              JavaAppletPlugin: Version: Java 7 Update 25 Outdated! Update
    Safari Extensions:
              DivX Plus Web Player HTML5 <video>: Version: 2.1.0.900
              Open in Internet Explorer: Version: 1.0
              ClickToPlugin: Version: 2.5.3
              DivX HiQ: Version: 2.1.0.900
    Audio Plug-ins:
              BluetoothAudioPlugIn: Version: 1.0 - SDK 10.9
              AirPlay: Version: 1.9 - SDK 10.9
              AppleAVBAudio: Version: 2.0.0 - SDK 10.9
              iSightAudio: Version: 7.7.3 - SDK 10.9
    iTunes Plug-ins:
              Quartz Composer Visualizer: Version: 1.4 - SDK 10.9
    User Internet Plug-ins:
              Move-Media-Player: Version: npmnqmp 071705000010 3rd-Party support link
              WebEx64: Version: 1.0 - SDK 10.6 3rd-Party support link
    3rd Party Preference Panes:
              DivX  3rd-Party support link
              Flash Player  3rd-Party support link
              Flip4Mac WMV  3rd-Party support link
              Growl  3rd-Party support link
              Java  3rd-Party support link
    Old Applications:
              Microsoft Language Register:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        /Applications/Microsoft Office 2011/Additional Tools/Microsoft Language Register/Microsoft Language Register.app
              /Users/[redacted]/Library/Application Support/WebEx Folder/1326
                        Cisco WebEx Event Center:          Version: 1304.07.2811.0 - SDK 10.5 3rd-Party support link
                        convertpdf:          Version: 1.2 - SDK 10.5 3rd-Party support link
                        asannotation2:          Version: 1206.25.2804.0 - SDK 10.5 3rd-Party support link
              Neat ADF Scanner 2008 10_5:          Version: 1.0.0.15 - SDK 10.5 3rd-Party support link
                        /Library/Image Capture/Devices/Neat ADF Scanner 2008 10_5.app
              SLLauncher:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        /Library/Application Support/Microsoft/Silverlight/OutOfBrowser/SLLauncher.app
              /Users/[redacted]/Library/Application Support/WebEx Folder/1324
                        convertpdf:          Version: 1.2 - SDK 10.5 3rd-Party support link
                        Cisco WebEx Meeting Center:          Version: 1304.23.2811.0 - SDK 10.5 3rd-Party support link
                        asannotation2:          Version: 1206.25.2804.0 - SDK 10.5 3rd-Party support link
                        atmsupload:          Version: 1209.12.2806.0 - SDK 10.5 3rd-Party support link
              Amazon MP3 Downloader:          Version: INFO_PLIST_VERSION - SDK 10.4 3rd-Party support link
              /Applications/Microsoft Office 2011
                        Microsoft PowerPoint:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Excel:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Outlook:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Word:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Document Connection:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
              Solver:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        /Applications/Microsoft Office 2011/Office/Add-Ins/Solver.app
              /Applications/Microsoft Office 2011/Office
                        Microsoft Graph:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Database Utility:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Office Reminders:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Upload Center:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        My Day:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        SyncServicesAgent:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Open XML for Excel:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Alerts Daemon:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Database Daemon:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Chart Converter:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
                        Microsoft Clip Gallery:          Version: 14.3.4 - SDK 10.5 3rd-Party support link
              /Applications/iWork '09
              Microsoft AutoUpdate:          Version: 2.3.6 - SDK 10.4 3rd-Party support link
                        /Library/Application Support/Microsoft/MAU2.0/Microsoft AutoUpdate.app
              /Library/Application Support/Microsoft/MERP2.0
                        Microsoft Error Reporting:          Version: 2.2.9 - SDK 10.4 3rd-Party support link
                        Microsoft Ship Asserts:          Version: 1.1.4 - SDK 10.4 3rd-Party support link
              /Users/[redacted]/Downloads
                        Install Spotify 7:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        Install Spotify 3:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        Install Spotify:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        Install Spotify 2:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        Install Spotify 4:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        Install Spotify 5:          Version: 1.0 - SDK 10.5 3rd-Party support link
                        Install Spotify 6:          Version: 1.0 - SDK 10.5 3rd-Party support link
    Time Machine:
              Time Machine not configured!
    Top Processes by CPU:
                  97%          Microsoft Outlook
                  16%          Google Chrome
                   5%          WindowServer
                   3%          Finder
                   2%          EtreCheck
    Top Processes by Memory:
              180 MB          Finder
              164 MB          soffice
              156 MB          mds_stores
              147 MB          Google Chrome
              131 MB          Numbers
    Virtual Memory Information:
              928 MB          Free RAM
              2.59 GB          Active RAM
              1.22 GB          Inactive RAM
              1.57 GB          Wired RAM
              31.52 GB          Page-ins
              1.33 GB          Page-outs

    Follow these instructions to uninstall MacKeeper. They have been tested with the most recent version of MacKeeper (v 2.8). Earlier versions than the one released in 2012 require more extensive work to uninstall all its components.
    The effects of having actually used MacKeeper to do anything are a completely different matter. The fastest way to take an exquisitely designed and painstakingly engineered Mac and make it run like a steaming pile of dung is to install and use such ill-conceived "cleaning" or "security" products. This is just one example of a broad category of time- and money-wasters capable of causing damage that can only be rectified by reinstalling OS X, restoring from a backup, or completely erasing your system and rebuilding it from the ground up. Never install such junk on a Mac.
    If you used MacKeeper to encrypt any files or folders, use MacKeeper to un-encrypt them first.
    Quit the MacKeeper app if it is running.
    Open your Applications folder: Using the Finder's Go menu, select Applications.
    Drag the MacKeeper icon from your Applications folder (not the Dock) to the Trash.
    You will be asked to authenticate (twice):
    You do not need to provide a reason for uninstalling it:
    Just click the Uninstall MacKeeper button. You will be asked to authenticate again.
    After it uninstalls you may empty the Trash and restart your Mac. All that will remain is an inert log file that does nothing but occupy space on your hard disk.

  • Hi, i'm new using numbers, and when I try to open a excel file don't let me do it, instead appears a box whit a error and close app,  any help?

    Hi, i'm new using numbers, and when I try to open a excel file don't let me do it, instead appears a box whit a error and close app,  any help?

    What does the error say?
    A couple of thoughts: the file is corrupted or is password-protected. Corruption is more likely to cause Numbers to crash & Numbers cannot open password-protected Excel files. Try using one of the free Office clones & see what happens.

  • Intermittent Error 41106 Error when trying to open an Excel file.

    I am having an intermittent problem while opening an Excel file.  The problem only occurs occasionally during execution of my program.  My program has a cluster of buttons each button opens a sub VI that is part of a calibration process.  The first VI generates an EXCEL filename that is used to save all calibration data.  A template is opened, data is placed in this template, and then it is saved under the generated filename.  Most of the time this seems to work fine, but every once in a while I receive a -41106 error indicating that Microsoft EXCEL did not open.  As far as I can tell when I run each sub VI independently they work fine and no errors are generated.  Does anyone know why this might be happening?  I would appreciate any help.
    Thanks 

    What version of LabVIEW and the Report Generation Toolkit are you using?  I remember adding some code in the 1.1 version of the toolkit to attempt to avoid some Microsoft Excel latencies with opening/closing the application repeatedly, but it was by no means fool proof, since Excel sometimes takes its sweet time leaving memory when the application exits.  Without knowing any more specifics, my best suggestion is for you to add a small delay between successive operations regarding opening/closing Excel and see if that helps.  Also, if you could post a simple VI that demonstrates the behavior, that would be extra helpful.
    Oh yeah, and another suggestion would be to open one report reference at the beginning of your program, and use this reference through the whole thing...I understand that this might not be possible, though, if you're opening different worksheets throughout the course of your application running.
    Good luck,
    -D
    P.S. - For those of you reading this wondering why I would automatically assume MegaMan is using the Report Generation Toolkit, he cites error -41106, which is an error specific to this toolkit.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Office 2013 can't open word, excel files from the network after upgrade to 8.1

    Hello,
    Recently, I upgraded all PCs from WIN 8 to Win 8.1. After the upgrade I noticed that I can't open any word documents and excel files. Before the upgraded I have no problem opened any files. All PCs have over 500GB free space on hard drive. Other PCs that
    run Win 7 have no problem open them only the one with Win 8.1. This is what I got:
    I right click--> property and there is no unblocked. All files resided on the network server.
    Please help.
    Jimmy

    Hi Jimmy,
    Did you get any error message when you try to open an Excel file/Word document?
    If so, you can post the error message and  event log here.Also ,if you had antivirus software installed, try to disable them to test this issue.
    In addition, what happens if you add the network server location as a trusted location?
    Wind Zhang
    TechNet Community Support

  • Read an excel file using JSP in MII 12.1

    Hi,
    I want to read an excel file using jsp page. I dont want to use the UDS or ODBC for connecting to excel.
    I am trying to use org.apache.poi to read the excel file in jsp page.
    While running, its showing a compilation error "package org.apache.poi.hssf.usermodel does not exist"
    I have the jar files for it, where do we need to upload it so that jsp page works.
    Thanks a lot
    Regards,
    Neha Maheshwari

    The user doesn't want to save the excel file in server.
    I want to upload file and save its contents in database.
    I have the code to read and save excel data in database but not able to get the location to deploy the jar file.
    In general, if we are creating a jsp page in MII workbench which is using some jar file.
    Whats the location to upload this jar file so that the jsp page works correctly?

  • I would like to upload a excel file using jsp

    Hi,
    I would like to upload the excel file using jsp in my netbeans ide. Please help.
    I don Know what is the error in this jsp file. It is not showing any thing and the file is also not getting uploaded.
    Please gothru the code below.
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ page import="java.io.*" errorPage="err.jsp"%>
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="<html:rewrite page="/design.css" />" rel="stylesheet" type="text/css">
    <title>Upload Page</title>
    </head>
    <body onKeyDown="DisablingBackFunctionality()" onLoad="DisablingBackFunctionality()">
    <html:form action="download" >
    <div style="position:absolute; left:100;top:200;">Select an excel File :<input type="file" name="uploadfile"></div>
    <div style="position:absolute; left:190;top:250;"><input type="submit" name="Submit" value="Read"></div>
    <div style="position:absolute; left:336;top:250;"><input type="reset" name="Reset" value="Clear"></div>
    mainmenu
    </html:form>
    </body>
    </html>
    <%
    String contentType = request.getContentType();
    if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) {
    DataInputStream in = new DataInputStream(request.getInputStream());
    int formDataLength = request.getContentLength();
    byte dataBytes[] = new byte[formDataLength];
    int byteRead = 0;
    int totalBytesRead = 0;
    while (totalBytesRead < formDataLength) {
    byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
    totalBytesRead += byteRead;
    String file = new String(dataBytes);
    //out.println("<br> file :"+file);
    String saveFile = file.substring(file.indexOf("filename=\"") + 10);
    //out.println("<br> savefile :"+saveFile);
    saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
    //out.println("<br> now file1 :"+saveFile);
    saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1, saveFile.indexOf("\""));
    //out.println("<br> now file2 :"+saveFile);
    //out.print(dataBytes);
    String ext = "";
    if (saveFile.indexOf(".") != -1) {
    ext = saveFile.substring(saveFile.lastIndexOf("."));
    int lastIndex = contentType.lastIndexOf("=");
    //out.println("<br>lst index of"+lastIndex);
    String boundary = contentType.substring(lastIndex + 1, contentType.length());
    //out.println("<br> boundary"+boundary);
    //out.println("<br> file :"+file);
    int pos;
    pos = file.indexOf("filename=\"");
    //out.println("<br> now 0 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 1 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 2 :"+pos);
    pos = file.indexOf("\n", pos) + 1;
    //out.println("<br>now 3"+pos);
    int boundaryLocation = file.indexOf(boundary, pos) - 4;
    int startPos = ((file.substring(0, pos)).getBytes()).length;
    int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
    FileOutputStream fileOut = new FileOutputStream("D:\\" + saveFile);
    //FileOutputStream fileOut = new FileOutputStream(saveFile);
    //fileOut.write(dataBytes);
    fileOut.write(dataBytes, startPos, (endPos - startPos));
    fileOut.flush();
    fileOut.close();
    session.setAttribute("fil", saveFile);
    //out.println("File saved as " +saveFile);
    %>
    <script type="text/javascript" >
    function DisablingBackFunctionality()
    var URL;
    var i ;
    var QryStrValue;
    URL=window.location.href ;
    i=URL.indexOf("?");
    QryStrValue=URL.substring(i+1);
    if (QryStrValue!='X')
    window.location=URL + "?X";
    </script>
    Please let me know the result as soon as possible. Its my very urgent.
    Thanking Yu,
    Muthu Kumar.R

    No.
    Mylenium

  • Opening an Excel file configures MSO Pro 2007

    Using Win7 & MSO Pro 2007.
    When I try to open an Excel file two unusual things happen after the splash window opens
    1> A message box opens and says stdole32.tlb. When dismissed by clicking
    [OK]...
    2> A window opens and starts to configure MSO Pro 2007 which takes 20-40 seconds to complete
    Taking a clue from KB 2528748 ..
    3> I looked in the registry at:  HKCU\Software\Microsoft\Office\12.0\Excel\Options and
          found no NoReReg Key, so
    4> I executed , in the RUN BOX..
       reg add HKCU\Software\Microsoft\Office\12.0\Excel\Options /v NoReReg /t REG_DWORD /d 1
    The registry now contains the appropriate noReReg key BUT the the behavior remains unchanged.
    Is this likely due to the unclear message about stdole32.tlb at
    1>?
    Could some one help me unravel and fix this nuisance problem?
    Thanx
    Arvin

    Hi,
    Please try the following method and check if it is helpful:
    Right Click the Excel>Properties>Compatibility>Choose Run this program in compatibility mode and Run this program as administrator
    Copy/paste a new stdole32.tlb from installation copy or other pc
    More similar issue:
    http://answers.microsoft.com/en-us/office/forum/office_2007-office_install/stdole32tlb-file-missing/ba3e940d-d628-4334-ac89-5e8ac9878093
    http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_28171576.html
    http://andyjwilliams.co.uk/technology/vista-office-2007-installation-problems-stdole32tlb/
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Opening an excel file from a button. square brackets in filename

    Internet explorer 6. Apex 3.1
    When I open an excel file (via a button) , it has the filename as follows:
    production_report[1].csv
    The prompt to save or open has the name as production_report.csv
    This prevents people saving the opened file as square brackets are not allowed in the file name.
    Is this an apex issue (ie a problem with the way I specify the filename) or a browser issue, and is there a solution?
    I am passing the filename in to my excel download page using the items/values settings.
    eg
    ITEM P12_FILENAME
    ITEM VALUE production_report.csv

    Yes, It works on firefox. It is only an issue with Internet Explorer.
    However our web based application has to use IE and therefore when it calls apex it is in an IE browser.
    I am really just producing a csv file, and opening it in excel. If this was fixed (or customisable in some way in IE that would help)

  • How to stop prompt while opening an excel file in new window

    hi all
    i made one table in jsf and i am having two icons corresponding to each row one for open and one for save. on the click of open i am calling web services getting the excel file and opening it but it is happening only . when i choose to open option from the prompt which comes when i click on the link. how to remove that prompt so that on click of the open it should directly open the excel file. plzzzzzzzzz hepl

    in the url of the new page that you are opening add --> &RetainAM=Y at the end.
    Following points should be useful :
    Suppose ,you have to open a new window from your page by clicking on a link or a button and after opening, when you click on any button in the parent page, if you are getting a session out error… try the following solutions:
    1.     Add retainAM=Y in the destination URI of the button or link
    2.     If you have the back button handling in your code, ensure that…
    if (!pageContext.isBackNavigationFired(true)) is written instead of
    if (!pageContext.isBackNavigationFired(false))
    3.     Also ensure that the trasaction name is exactly same in both startTransactionUnit and end TransactionUnit
    TransactionUnitHelper.startTransactionUnit(pageContext, "sameName");
    TransactionUnitHelper.endTransactionUnit(pageContext, " sameName ");

Maybe you are looking for