Application/vnd.ms-excel

Hi!
I want to display(open) an excel file from a java class but I have a problem.
I am using the code as below:
setContentType("application/vnd.ms-excel");
and it works.
The problem is that i want to visualize datas from a query.
One of this datas is the italian CAP (postal code) that sometimes starts with 0. For examples: 09100.
Well, excel file does not show the first zero although the field is a string,.
someone can help me?
Thank you!

Wrote a small program for you:
   public boolean isString(String s) {
      if (s==null || s.length()==0) return true;
      for (int i=0;i<s.length();i++) {
         if (s.charAt(i)<'0' || s.charAt(i)>'9') return true;
      if (s.startsWith("0")) return true;
      return false;
   }This little gem will return true if a string contains non-numeric digits, it will also return true if the string contains all digits but starts with a zero.
;o)
V.V.
PS: don't forget the dukes if this helps!

Similar Messages

  • MIME TYPE ; application/vnd.ms-excel

    HI
    i have bsp page which i have declared mime type application/vnd.ms excel the idea is to download the entire contents in local machine . when i click generate excel i get 3 buttons open ,save ,cancel. how can i capture the event open in the page .a sample code will be very helpfull
    reagrds
    Prasun

    Hi
    This is sample code need to be declared in the OnInputProcessing an event for an ID:
    data:
      w_event type ref to cl_htmlb_event,
      w_obj type ref to object,
      w_mod type ref to cl_htmlb_inputfield,
      w_module type string.
      data:
       tv type ref to cl_htmlb_tableview,
       tv_data type ref to cl_htmlb_event_tableview.
      call method cl_htmlb_manager=>get_event
      exporting
        request = runtime->server->request
      receiving
        event   = w_event.
      case w_event->id.
      when 'open'.
        call method cl_htmlb_manager=>get_data
          exporting
            request = runtime->server->request
            name    = 'inputfield'
            id      = 'module'
          receiving
            data    = w_obj.
           w_mod ?= w_obj.
           w_module = w_mod->value.
    endcase.
    'open' this open you need to declare in HTMLB  Button Tag with Option ID...in this way as soon as you click the Button OPEN the Event will be triggered
    Regards,
    Rajani

  • How to get at a mail of MIME type application/vnd.ms-excel?

    My java proggie has to deal with an email sent with Outlook '97 (don't ask me why it has to be that) and this email has the following header fields (see below). Now, my program works fine if the email has MIME type multipart/mixed. So, how do I have to do to handle an email of MIME type application/vnd.ms-excel (outline of logic or even some code snippet will be greatly appreciated)?
    Received: by chk_exchange6.whatever.local
         id <01C83718.A96E9AC0@chk_exchange6.whatever.local>; Wed, 5 Dec 2007 16:27:24 +0800
    Message-ID: <E839E45C64CF7E4D9E4E8A334B79363001F0DB62@chk_exchange6.whatever.local>
    From: "somebody" <[email protected]>
    To: "me" <[email protected]>
    Subject: excel attached
    Date: Wed, 5 Dec 2007 16:27:24 +0800
    MIME-Version: 1.0
    Content-Type: application/vnd.ms-excel;
         name="nevermind.xls"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment;
         filename="nevermind.xls"
    Edited by: dickensl on Dec 5, 2007 11:47 PM

    Depends on what you want to do with it.
    If you want to access the data in the Excel spreadsheet
    and make sense of it, you're going to need some
    Java classes to interpret an Excel spreadsheet.
    Good luck on that. :-)
    If you just want to save the content in a file, as if it
    were an attachment, use msg.getInputStream()
    and copy the data to a file, like this:
            OutputStream out = null;
            InputStream in = null;
            try {
                out = new BufferedOutputStream(new FileOutputStream(file));
                in = msg.getInputStream();
                byte[] buf = new byte[8192];
                int len;
                while ((len = in.read(buf)) > 0)
                    out.write(buf, 0, len);
            } finally {
                // close streams, but don't mask original exception, if any
                try {
                    if (in != null)
                        in.close();
                } catch (IOException ex) { }
                try {
                    if (out != null)
                        out.close();
                } catch (IOException ex) { }
            }

  • Application/vnd.ms-excel dropping leading 0's

    I have a jsp page that successfully displays my data in an excel window on the browser. My user then will cut and paste the data from the screen to Excel running on their desktop. My problem now is the leading zeroes are dropping off. The data being passed are String objects and are being passed as such. Is there any info regarding formatting that allows one to put a special character in the String object to keep the zeroes. I have tinkered with placing a single quote into the String and it works, but when cut and pasted to Excel running on the desktop the sinqle quote remains. I cannot find any docs that discuss how to format the cells in the browswer.
    javaembryo-
    code sample
    <%@ page language="java" contentType="application/vnd.ms-excel" %>
    <td><%=LawsonJspUtil.print( modifyRecord.getSubmitStatus() ) %></td>
    The LawsonJspUtil.print() method takes a String object, checks for null and returns a String object. If the String is null, it outputs a space to fill the column. I could use this method to properly format the column to keep the leading zeroes.

    Wrote a small program for you:
       public boolean isString(String s) {
          if (s==null || s.length()==0) return true;
          for (int i=0;i<s.length();i++) {
             if (s.charAt(i)<'0' || s.charAt(i)>'9') return true;
          if (s.startsWith("0")) return true;
          return false;
       }This little gem will return true if a string contains non-numeric digits, it will also return true if the string contains all digits but starts with a zero.
    ;o)
    V.V.
    PS: don't forget the dukes if this helps!

  • Report won't run for mimetype=application/vnd.ms-excel

    Hi,
    My customers need to run reports in excel and type in parameters into the parameter from. The URL is:
    http://myServer/dev60cgi/rwcgi60?xyz+server=Repserv+report=rptName.rdf+destype=cache+paramform=yes+desformat=delimited+mimetype=application/vnd.ms-excel
    The parameter from shows up and all the LOVs are there, the reset botton works, the Submit Query botton only shows Submit (NO QUERY). The report won't run when I click on Submit botton.
    But it works perfectly if no mimetype=application/vnd.ms-excel in URL
    Can anybody help me to fix this ?
    Thanks

    The mimetype parameter was only introduced in 6.0.8.10 and above. What version are you running ?
    Thanks,
    Danny

  • WORKAROUND: "A document with the name 'vnd.ms-excel' is already open"

    I'm posting this in the hope that it might help someone else (or that someone else might suggest a better solution)...
    I'm using the technique described in the Integrating Oracle Reports in Oracle Forms Services Applications white paper. Basically, this means using RUN_REPORT_OBJECT to generate a report, and then navigating to a URL of the form...
    http://<host>/reports/rwservlet/getjobid<n>?server=<name>...to show it.
    I had the requirement that some reports (with DESFORMAT=DELIMITEDDATA) needed to open in Excel, so for these reports I added the MIMETYPE command to the URL, so that it was of the form:
    http://<host>/reports/rwservlet/getjobid<n>?server=<name>&mimetype=application/vnd.ms-excelThis appeared to work, but only for one report at a time. I could generate one report this way, and when I navigated to its URL, the report would be displayed by Microsoft Excel within a new browser window as expected. However, if I left the browser window open, then generated a second report and navigated to its URL, a new, empty browser window was displayed, but a "Microsoft Excel" message box appeared with the following message:
    A document with the name 'vnd.ms-excel' is already open. You cannot open two documents with the same name, even if the documents are in different folders.
    To open the second document, either close the document that's currently open, or rename one of the documents.
    When I chose OK (the only button), the message box closed, but the new browser window remained empty.
    If Excel was already running to begin with, the message box was obscured behind other windows, and the new browser window remained empty and appeared to never finish loading (because it was waiting for a response from the message box). The message box only appeared if I explicitly navigated to Excel (for example, using the taskbar). When I chose OK, a "File Download" dialog appeared, followed by a message box that reported the following:
    Microsoft Excel for Windows has encountered a problem and needs to close. We are sorry for the inconvenience.
    When I closed this message box, Excel shut down.
    I could not find this documented anywhere, but it appears as if Excel interprets the text after the last "/" in the URL as the file name. In my case, this was the same text every time (specifically "vnd.ms-excel"), which caused problems because Excel does not allow you to open two files with the same name.
    My workaround was simply to add the "JOBNAME=/<n>" command (where <n> is the job ID) to make the text after the last "/" unique (at least in my case). In other words, by using a URL of the form...
    http://<host>/reports/rwservlet/getjobid<n>?server=<name>&mimetype=application/vnd.ms-excel&jobname=/<n>...I was able to avoid the problem. For example, for job ID 123, the URL would be...
    http://<host>/reports/rwservlet/getjobid123?server=<name>&mimetype=application/vnd.ms-excel&jobname=/123...and Excel would interpret the file name as "123".
    Hope this helps.

    Thanks for posting, this solution worked!

  • Office 2013 Home & Business Edition - None of the application (Word, Powerpoint, Excel or Outlook) is opening, not even in safe mode..

    Office 2013 Home & Business Edition - None of the application (Word, Powerpoint, Excel or Outlook) is opening, not even in safe mode.. I tried to run the application in compatibility mode by right clicking the excel.exe and choosing the compatibility
    mode, still no success. It is installed on Windows 7 Professional SP1. All the latest updates are already installed. I have also tried Microsoft fixit, but still no Success. Please help!! 

    I'm so sorry that I forgot the Office programs even not open in safe mode and provide useless information in my last reply.
    The problem persists when we perform a Windows clean boot, right?
    Were the Office programs suddenly not working? Or it just can’t be open after you install it? Did you get any error message?
    If you haven’t try a repair of your Office installation, we can try it to check the result:
    http://office.microsoft.com/en-us/project-help/repair-office-programs-HA010357402.aspx
    In addition, try to use Event Viewer to see if we can get some useful error log about this problem. See:
    http://windows.microsoft.com/en-us/windows/open-event-viewer#1TC=windows-7
    Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • Error message when I try to print: unsupported document-format"application/vnd.cups-command. I recently had my hard drive replaced in my early 2010 21" iMac. Can anyone help?

    Error message when I try to print: unsupported document-format"application/vnd.cups-command". I recently had my hard drive replaced in  my early 2010 21" iMac. Anyone know anything about this? Thanks in advance.

    What system are you running?  Have you tried going to the Canon website to download and install the latest drivers for that model?
    Are you running Time Machine?

  • Vnd.ms-excel.numberformat:@

    I use a cloud-computing app, Salesforce, to maintain some databases. The report module, which produces nice-looking formatted reports, allows you to export the data as .csv files, which can be opened without trouble by Numbers. It also allows you to export them (formatting intact) as .xls files, which are (according to their first line) in this vnd.ms-excel.numberformat. I recently downloaded a trial of Microsoft Office, and those files were opened without trouble by excel (formatting intact).
    Is there any way to open them in Numbers so that the formatting remains? Here is a sample lines: it's obviously html code but I can't get Numbers to read it as that.
    "<tr><td style=""vnd.ms-excel.numberformat:@"">xx Durst Membership Donation - 03/05/2010</td><td align=right>5.00</td><td align=right>3/5/2010</td><td style=""vnd.ms-excel.numberformat:@"">xx Durst Household</td><td style=""vnd.ms-excel.numberformat:@"">Membership 2010</td></tr>"

    and which I spelt properly in the other thread.
    I have a friend named Ivan, so I slipped.
    My name is CLARE, not ClaIre, or Clara, or any number of other variations. My last name is DURST, not Durt, nor Dust, nor Rust. I get used to misspellings!

  • Application/vnd.fdf not displaying in remote browser

    Hi,
    I was hoping someone could help me or point me to a topic that would. I didn't find what I needed after searching.
    I'm using Adobe's FDF Toolkit to build an fdf and send it to the browser.
    I have set my contentType to application/vnd.fdf and when I test it locally it works fine. I have both Acrobat Pro and Adobe Reader on my box and it uses Acrobat to open the resulting pdf.
    When I go to a remote box that only has Adobe Reader on it, the request for the pdf is submitted, Reader starts up, then displays a blank page.
    if I change it to just application/fdf, the browser doesn't know what to do with it right away and asks if you want to save or open it, if you choose open, then Adobe Reader displays the pdf correctly.
    i want to get this to work with the vdn.fdf setup since if I do just fdf, it asks you what you want to do and opens up a reader window, the displays the pdf in the browser. The reader window stays around.
    Does anyone have any ideas why it wouldn't work remotely?
    Thanks,
    Chris
    I'm inserting my code below:
    public class AdobeTestAction extends Action {
    * Constructor
    public AdobeTestAction() {
    super();
    public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response)
    throws Exception {
    ActionForward forward = new ActionForward();
    AdobeTestForm adobeTestForm = (AdobeTestForm) form;
    String date = GregorianCalendar.getInstance().getTime().toString().replace( ' ', '_' ).replace( ':', '_' );
    try {
    FDFDoc fdf = new FDFDoc();
    fdf.SetValue( "borrowerName", adobeTestForm.getBorrowerName() );
    ... more SetValues()
    fdf.SetFile( "http://myServer/myPath/myPDF.pdf" );
    response.setContentType( "application/vnd.fdf" );
    ServletOutputStream out = response.getOutputStream();
    fdf.Save( out );
    catch ( Exception e ) {
    System.out.println( e.toString() );
    return null;
    }

    fdf is a Adobe PDF Form type file.
    It associated with adobe reader.
    it works if I do it as application/fdf, it just has a couple of side affects that way. It asks if you want to save or open first, and it opens reader and leaves it open.
    application/vnd.fdf works on my local test env. But it doesn't work when I try to hit it from a remote box.

  • Google Chat plug-in error application/vnd.gtpo3d.auto

    I have always been able to do google video chat from directly within my email inbox, until a few days ago.  I am able to make a video call and can hear the other person's voice, but can't see any video.  It's a white screen, that says 'plugin error'.  And when I click on that, it points an error out saying application/vnd.gtpo3d.auto.  Please help.  I want to be able to video chat again.  sidenote - i have tried google hangouts and that doesn't make calls to the other person for some reason (other person is using an iPad).  I'm on MacBook Pro.
    Safari 5.1.10
    Mac Version 10.6.8
    Please help - thank you.

    I too am facing the same problem. Mine in Macbook Pro
    Software  OS X 10.9.2
    Safari Version 7.0.3 (9537.75.14)

  • How to launch application like word, excel, powerpoint or *.exe on client

    Hi,
    could anyone advise which iView or other portal application I have to use, to get an application like word, excel, powerpoint or *.exe on Clinet side (e.g. notepad.exe) working.
    Solution should be: I will klick in the fine navigation on the link word. Word should be open. ALso it should work with other applications.
    Is there any solution for this? Maybe even a standard solution (without coding).
    I have created km document iView (.html page) to link to the applications via java scripts in the html code. But this solution ist not the one i am searching for.
    Regards,
    Eduard
    Edited by: Eduard Günther on Jan 28, 2009 10:24 AM

    Hi .
    You can use these method in sequence as follow:
    1)  CALL METHOD cl_gui_frontend_services=>file_open_dialog
         this method let the user choose a file form his computer ad return the file path (ex.: C:/..../file.txt)
    2) CALL METHOD cl_gui_frontend_services=>gui_upload
         this method upload the file and return the file content.
    After you got the content of the file you can store it inot a custom table .
    There are similira merhod for the inverse problem (file download).
    Regards,
    Fabri

  • Firefox opens application/vnd.adobe.xdp+xml in new Tab/Window

    Hello,<br /><br />I´m using  Livecycle Designer 7.0, Acrobat Reader 7, 8 and 8.1. <br />We want to open XDP File (with a PDF enclosed element) in browser using a Java/Servlet.<br />It opens fine in IE 6.0 but when we open it with Firefox 2.0.0.9<br />it´s opened in a new tab!. Any idea to avoid this behavior?. Sth worng with de pluggin?<br /><br />Thanks<br /><br />/*Servlet code*/<br />String content = "<?xml version=\"1.0\" encoding='UTF-8'?>\n" +<br />"<?xfa generator=\"AdobeDesigner_V7.0\" APIVersion=\"2.2.4333.0\"?>\n" +<br />"<xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">\n" +<br />"<xfa:datasets xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\">\n" +<br />"<xfa:data xfa:dataNode=\"dataGroup\">\n";    +<br />"<form1><TextField1>aaaaaaaa</TextField1></xfa:data>" +<br /><pdf href=\"pathname/filename.pdf\" xmlns=\"http://ns.adobe.com/xdp/pdf/\" />\n" +                <br />"<xfdf xmlns=\"http://ns.adobe.com/xfdf/\" xml:space=\"preserve\">\n" +<br />"</xfdf>\n" +<br />"</xdp:xdp>\n";<br />                <br />ServletOutputStream out = response.getOutputStream();<br />response.setContentType("application/vnd.adobe.xdp+xml");<br />response.setHeader("Content-Disposition","inline;filename=xdpfile.pdf");                              <br />bytes[] contentBytes = content.getBytes("UTF-8");<br />response.setContentLength(contentBytes .length);<br />out.write(contentBytes );<br />out.flush();<br />out.close();<br />/*Servlet code*/

    I have a different issue.  When I open the xdp in a browser it only displays the xml code on the screen.  Do I need something else installed on my intranet server?  I can open the referenced PDF directly in the browser and if I map to the drive the xdp is located I can open it directly.  The browser just wont work for me IE 6.  <br /><br />Any help would be greatly appreciated.<br />Xdp file:<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><?xfa generator="XFA2_4" APIVersion="2.4.6053.0"?><br /><xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/"><br /><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"<br />><xfa:data<br />><topmostSubform<br />><memberNum>1234</memberNum<br />><memberName>Brian</memberName<br />><currDate>3/25/2009</currDate><br /></topmostSubform></xfa:data><br /></xfa:datasets><pdf href="Sign.pdf" <br />xmlns="http://ns.adobe.com/xdp/pdf/"/></xdp:xdp>

  • Won't load application/vnd.wap.xhtml+xml

    Used to view 511NY.org (Road conditions) on FF 3.X. Upgraded to FF 4 and now asks me what to do with 511NY.org because it's an application/vnd.wap.xhtml+xml. Asks do I want to Save it or Open it? I say Open it with FF, then instead FF4 downloads a page to my hard drive. The text of the page is html as above but it won't open. I tried it on IE7 and it opened correctly just as it used to on FF 3.X. Please help! thanks.

    See: http://support.mozilla.com/en-US/questions/796303
    The user-agent detection was incorrectly identifying FF4 as a mobile browser, in turn redirecting to a mobile version. Install the following addon to workaround this problem until it's fixed: https://addons.mozilla.org/en-us/firefox/addon/xhtml-mobile-profile/
    Barb

  • Unsupported media type:application/vnd.rim.cod

    Hullo!
     I have a Blackberry Curve 8320, and am trying to download the new (and apparantly award-winning) Nimbuzz IM client to my phone via their site at http://get.nimbuzz.com  but am getting an error when I try.
     First I am told "The item you selected cannot be displayed. Do you wish to save the item?"  If I select No, I get "Unsupported media type:application/vnd.rim.cod"
     Saving the file "Nimbuzz-1.cod" and then trying to Explore to it and launch it doesn't seem to do any good either.
     I was pretty sure .cod files are the correct file type for this sort of thing, and I can't find anything on the Internet about this error message, or anyone else experiencing this problem. 
      Please help!

    Hi Im having the same problem, and i havent found anything about it. Did you fix it? can you please tell me how?
    Thanks

Maybe you are looking for

  • How to include in table of contents the list of figures and list of tables?

    How to include in table of content the "Table of contents", "List of figures" and "List of tables"? All are generated with function Table of contents, but they will not appear in generated table of contents even if they have proper style of headings

  • Idoc to FCC error.

    HI, Scenario is Idoc to File scenario using BPM, needs to drop the file using FCC and BPM collect messages is used All the fields are populating successfully but facing issues with serial number and date fields, 1. With respect to Serial Number: from

  • Pmnt block changed when amount split use - how this funct. set?

    Hi experts, when i use bookmark - amount split in tcode mir7 bookmark Payment changed, a specialy pmnt block changed. I set Maintain Terms of Payment with Default value for the payment blocking key = N. But when i fill amount split payment blocking k

  • Changed wav file names – files unrecoverable

    Hi. I was asked to import some important imterviews made on an iPod mini and an ExtremeMac Micromemo onto a Mac, but, as requested, I change the file names first. Since changing the file names the files are completely unplayable, undownloadable and u

  • X-Fi card not detected

    Just installed this card, and when I run the installer to install the drivers, it says there is no card detected. Any ideas? Thanks very much..