How to disable Format Warning when displaying JSP in Excel under MS-Office

We have an application running in WebSphere 6.0 container, the application displays jsp data in Excel, it had no problem before MS-Office 2007 was install. However, after MS-Office 2007 is used, following format warning dialog box is always displayed:
The file you are trying to open, ’Requests[1].xls’, is in a different format than specified by the file extension.
Verify that the file is not corrupted and is from a trusted source before opening the file.
The user has to click the "Yes" button before the Excel report can be successfully displayed. This is not acceptable by our production users, and I need your helps to get rid of this dialog box.
The application uses struts. The Action class retrieves data from database and the data is forward to the result jsp
in an data object set in an attribute of the session's Request object. The Action class also set the display info, such as the contentType,etc., in session's Response object (please see below for details).
The result jsp retrieves data from the data object and display in Excel according to the display info provided in the
session response object.
To eliminate any possible problem that may be caused by the data, I have simplified the result jsp by removing original
codes (such as data object forwarded from Action, and Tag Library, etc.), and just hardcoded few data for displaying in Excel, however, the same format warning box still always shows up.
My Action class set display info as below:
response.setContentType("application/vnd.ms-excel");
response.setHeader("Expires", "0");
response.setHeader("Cache-Control","must-revalidate, post-check=0, pre-check=0");
response.setHeader("Pragma", "public");
response.setHeader("content-disposition","attachment; filename=Requests.xls");
My simplified result jsp is listed below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<!-- <%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt'%> -->
<TITLE></TITLE>
</HEAD>
<BODY>
<TABLE border="1">
     <TBODY>
     <TR>
     <td><p align='left'>myData1</p></td>
     <td><p align='left'>myData2</p></td>
     <td><p align='left'>myData3</p></td>
     <td><p align='left'>myData4</p></td>
     </TR>
     </TBODY>
</TABLE>
</BODY>
</HTML>
So, I reduced the result jsp to contain only few hardcoded data, but the format warning always shows up. Is it caused by inconsistency between the MS-Office 2007 browser and the JSP engine in WebSphere 6.0 Web container? Need your help to resolve this problem.
Thanks in advance.

That's the caveat of fooling your webbrowser and Excel with a plain HTML page along an Excel content-type and Excel extension.
Don't do that. That's plain stupid. Provide a real binary Excel file. You can create one using Apache POI HSSF or Andy Khan's JExcelAPI. Alternatively -and more recommended in case of large reports-, just use the CSV format. It's easy to create a CSV file in 20 lines of code and Excel perfectly understands CSV formats. Don't forget to change content-type to CSV.

Similar Messages

  • How to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi?

    I'd like to how to disable 'Enable JavaScript' and 'Display PDF in browser' in Adobe Reader 9.1 msi.
    Any help would be appreciated.

    NeoChang:
    You can modify the installation package using the Adobe Customization Wizard to toggle the "Display PDF in Browser" but I have not found a setting to disable JavaScript from the Wizard. I have created a script which makes the changes, but it has to be run for every user since that info is stored in the User hive of the Windows registry.
    Disable JavaScript:
    REG ADD "HKCU\SOFTWARE\Adobe\Acrobat Reader\9.0\JSPrefs" /v bEnableJS /d 0 /t REG_DWORD /f
    Disable Browser Integration:
    REG ADD "HKCU\Software\Adobe\Acrobat Reader\9.0\Originals" /v bBrowserIntegration /d 0 /t REG_DWORD /f
    Michael
    ~Simplicity of Character is a Natural Result of Profound Thought~

  • How to disabled mutli desktop when I using Full Screen?

    How to disabled mutli desktop when I using Full Screen?
    Some app have a preferences option to do this which like iTerm2
    In Lion-Style FullScreen windows, I can't use command + tab to  quickly switch between in the apps, I must switch to the  app own desktop which is using fullscreen, It's so trouble. I even think this is a flaw in Apple's design.
    So, How can I have use this  feature in others apps such as Google Chrome, Mail, Safari and so on.
    Please Help me!  Thanks! Thanks! Thanks!

    nobody can help me ?

  • How to disable autostart (application) when managed server restart ?

    Hi Ppl,
    How to disable autostart (application) when managed server restart ?
    I want some of the applications to remain not started. In WebSPhere, we have an option disable auto start for applications.
    I don't find in weblogic.
    Thanks

    Hi,
    I agree with Faisal. When you shutdown your WL server while the application is running, the thing is when you start your server again, it would automatically start the application with it. Now if the application was down when you shutdown the server, it _the application_ won't start with the server.
    So it depends on the application last state, when you start your server.
    Regards,
    Mohab

  • How to disable security warning on firefox 4

    how to disable security warning on firefox 4

    In particularly their is no disable function provided by mozilla. Their might have been ways in previous versions. But now it's Major topic discussed on the internet. Im having the same problem too, im not able to access some websites, and mostly which is dealt with money and trade.

  • How to disable 'Save' button when OAF and XML Publisher integrated...URGENT

    Hi,
    I am new to the OA Framework and XML publisher. I have been working on a requirement where I am designing a new page in Manager Self Service with few fields and a submit button. Also designed a RTF template in XML publisher to display the output in PDF format.
    When the details are entered on the page and click on 'Submit' button, the PDF will Open with the data populated. This is working perfectly... thanks to the forum.
    But my issue is: When the submit button is clicked, it displayes a dialog box with Open/Save/Cancel options and if I click the 'Open', the PDF will be opened. But my client is a retail client and they don't want store managers to save this PDF so either I have to skip this dialog box and directly open the PDF or I have to disable the 'Save' on the dialog box.
    Gurus -- Please help me how to achieve this. This is very urgent
    Below is the piece of code I am using in the controller to generate the PDF.
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    APP_NAME,
    TEMPLATE_CODE,
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF,
    null,
    pdfFile);
    Thanks in Advance,
    Naren

    Frank, thanks for the update.
    But do you want me to try ControllerContext.getInstance().getCurrentViewPort().isDataDirty(); in button disable property?
    I have written one method in my am like
    public boolean isTransactionDirty(){
    return getDBTransaction.isDity();
    and exposed that method to client side and i try to use this method in my button disable property as
    disable#{bindings.isTransactionDirty.execute} but this is not working.
    Thanks

  • How to disable windows dialogue when executing a script

    Hi there.
    I'm trying to automate a task that needs a PSD file to update a layer text.
    For this task my script reads an externar data from www.mydomain.es/resource.cfg.
    Everything has to be done automatically and the script will be programmed to run to a certain hour in my XP machine.
    Data is retrieved, but when  .jsx file tries to run a warning dialog displays in Windows. Something like:
    "Security alert: you are about to execute a script in Photoshop CS4. Do yo want to Continue(button) or Cancel(button).
    This prompt will ruin my script as i need to do everything automatically.
    Does anybody knows how to configure windows, the script or whatever so that the script just executes without asking?
    Thanks so much ofr your help.

    Found the solution:
    I have to place the script in the folder PS CS4 creates for scripts in XP located in documents and settings\user\My Documents\Adobe scripts
    There seems to be a trusted folder and won't display any warning
    •••(spanish lang. translation)
    Encontré la solución:
    Hay que copiar el script en la carpeta que se crea automáticamente al instalar PS CS4 y que se encuentra en documents and settings\usuario\Mis Documentos\Adobe Scripts
    Esa parece ser una zona de seguridad autorizada y no mostrará ninguna advertencia si se ejecuta desde allí

  • How to disable field validation when block is in query mode ?

    Hi,
    we use Jdev 11g TP3 and implemented a button to set a block of input fields in query mode.
    Some of this fields are mandatory.
    When performing an execute operation this mandatory fields are validated and the JS error message pops up.
    In query mode this fields must not be mandatory !
    How to disable the validation of those mandatory fields when the block are in query mode?
    BR
    Peter

    Hello Peter,
    A little correction to Chris' suggestion, it should be:
    <af:inputText value="#{bindings.<your field name>.inputValue}"
                        label="#{bindings.<your field name>.hints.label}"
                        required="#{!bindings.<your iterator name>Iterator.findMode && bindings.<your field name>.hints.mandatory}">
    ...etc...The only difference is the removal of the ? : operator since it isn't required and represents both an additional parsing and processing effort. Go micro-optimization!
    ~ Simon

  • "Bad image format" error when displaying an image on Nokia 6600

    I get a "bad image format" error when I try and display an image on a Nokia 6600 cellphone. The image displays correctly when I run it on the J2ME 2.1 Emulator, but gives an error on the phone. Plz help!!

    More info please... what kind of an image are you trying to display?

  • How to disable security warning while printing(Silent Print) from Javascript?

    We have a webapplication through which, we are creating a pdf document and trying to print it sliently ("Silent Print").
    Users who are having latest Adobe version, were getting javascript warning message. However, those with older versions able to "Silent Print", without any warning messages.
    How to disable this security warning while printing from Javascript?
    Warning message: "A script has requested to print an Acrobat file. This could print an entire document. Do you want to proceed printing?".
    Appreciate for your kind help.
    Thanks.

    It's a security warning so it can't be bypassed by anything within the file.

  • HOW TO DISABLE CPU behavior when no battery inside macbookpro ?

    I realized, when i do not have the abttery inside the macbook, what i do not fotne, to save chargecycles, that my cpu wil not go above 1ghz. i observed this with the use of the coreduotemp application, wich can be free downloaded and monitors temperature and cpu speed of your macbook. i wrote to the developper, and he confirms that observation, so it is not an software bug.
    First, i invite you to test this on your macs and report, and secound i would like to have a solution, i bought this mac for power, not for slow power.
    maybe someone knows how to disable this behavior, thx

    If your MBP is consistently running at 80°C or higher, there is probably a problem with it... My machine idles around 54°C (when connected to an external monitor -- less without) and maxes around 75°C when the processor and GPU are being pushed (i.e. video intense gaming).
    Additionally, the MBP's battery is not Lithium Ion -- it is Lithium Polymer -- and is designed to be used IN the laptop. You are worrying about nothing (or next to nothing); even if your theory is correct, you are perhaps talking about a 5% decrease in the overall lifespan of the battery...if you think that is worth the possibility of data loss, then I guess running without the battery is for you...
    However, you will not be able to disable the down-throttle of the CPU speed.

  • How to disable some color when printing separations in Ai CS6-CC (JS)

    Hello Everyone!
    Configuration: Win 7 Pro x64, Illustrator CS6x64-CCx64, default printer PDF.
    When printing separations from Illustrator CS4 following script prints all colors except Cyan (as was intended).
    But when printing from CS6-SS disable the color is not possible - all colors are printed without exception.
    var adoc = activeDocument;
    var o = new PrintOptions();
    o.colorSeparationOptions = new PrintColorSeparationOptions();
    o.colorSeparationOptions.colorSeparationMode = PrintColorSeparationMode.HOSTBASEDSEPARATION;
    o.colorSeparationOptions.inkList = adoc.inkList;
    for (var i = 0; i < o.colorSeparationOptions.inkList.length; i++) {
    if (o.colorSeparationOptions.inkList[i].name == 'Process Cyan') {
      o.colorSeparationOptions.inkList[i].inkInfo.printingStatus = InkPrintStatus.DISABLEINK;
    adoc.print(o);
    If you check, you have inkInfo.printingStatus Cyan changed to "InkPrintStatus.DISABLEINK".
    Why it is printed and how to disable?
    Thanks!

    Hi saaiful,
    Thank you for posting your question. window. will print header and footer.
    Here are some solutions I found after researching your issue:
    *[http://forums.mozillazine.org/viewtopic.php?f=12&t=216810]
    *[http://stackoverflow.com/questions/8228088/remove-header-and-footer-from-window-print]
    *[http://www.dreamincode.net/forums/topic/22598-using-windowprint-without-printing-header-and-footer/]
    *take a screenshot and create a page that is printable [http://www.webdeveloper.com/forum/showthread.php?210947-Using-window-print-without-printing-header-and-footer]
    *Target to another window then print: [http://www.liferay.com/community/forums/-/message_boards/view_message/3401817]
    Hope this helps.

  • How to disable power off when the phone is locked with pass code.

    Can anyone teach me how to disable power off function when the phone is locked?  With this , user is able To trace the iPhone when it goes missing. Besides, users will have enough time to remote wiped.

    i also had my phone stolen ... the first thing they did was turn off the phone so i couldnt track them.. you should need to enter your passcode in order to turn off the phone. i dont care if you cant do a hard reset.. i would rather loose the ability to do a hard reset for the added security .. besides without hard reset if it jammed badly i would just wait ontill the battery died.

  • Safari Anti-Phishing- How does it work "Warn When visiting.." option

    So, when you turn that feature on: Warn When Visiting A Fraudulent Website," exactly how does Safari know that? I know it was introduced way back in version 3.2, but does it use Goggles safe browsing website info still? I can't seem to find any documentation on it for Safari 5 in how it works.
    Also, if it does use Googles Safe-Browsing database, what happens when you turn that feature off and THEN turn it back on? Does it start from sratch or continue building the database where it left off?
    Message was edited by: powerbook1701

    The blacklists from Google’s Safe Browsing Initiative (where Safari checks for 'fraudulent websites') are contained in a database cache file called SafeBrowsing.db - the file was created when you first launched Safari, and if you have the browser open, the file is modified approximately every 30 minutes.
    In other words it is part of Safari's (version 3.2 onwards) anti-phishing security feature.
    As an alternative to turning off 'Warn when visiting a fraudulent website', which will lose you that important security feature, you could delete that database file, (but first close Safari:
    In Tiger:
    Home/Library/Caches/com.apple.Safari (this is a folder)/SafeBrowsing.db
    In Leopard*:
    Private/Var/Folders/AF/AFONO9KnGpijQuAcxb6vf++TI/Caches/com.apple.safari/Safari/SafeBrowsing.db
    In Snow Leopard*:
    Private/Var/folders/iI/iIaUOKJyFS0xmSIANVYiD++TI/-Caches-/com.apple.Safari/SafeBrowsing.db
    (*This location may vary depending on your OS. Also, the name of that weird sounding folder will be unique to each user.)
    You can get to the Private/Var folder by using Go To in the Finder menu.
    It will be recreated next time you open Safari, and will then start again collecting details of dodgy websites.
    If you are interested:
    How the Anti-Phishing feature of Safari 3.2 onwards works:
    http://www.macworld.com/article/137094/2008/11/safarisafebrowsing.html

  • How to disable auto notification when Leads assigned

    Hi,
    Does anyone know how to disable or modify the automatic notification that gets sent to owner of Leads when rules assign Leads?
    I've found where to change the "from" email address but want to change/stop these altogether
    Thanks
    Example below:
    -----Original Message-----
    From: XXXXX
    Sent: Monday, November 17, 2008 10:09 PM
    To: XXXXX
    Subject: Lead(s) have been assigned to you in Oracle Siebel CRM On Demand
    192 Lead(s) have been assigned to you in Oracle Siebel CRM On Demand.
    Click the following URL to review your new Leads:
    https://secure-XXXXX.crmondemand.com/OnDemand/user/LeadsHomepage

    At this time there is no way to disable this email notification to the owner of the lead as a result of going thru the lead assignment rules.

Maybe you are looking for

  • HP Photosmart Premium All in One C410 series - alignment issue

    Printer is disaligned, cannot realign, tried default, tried aligning a few times, same result - get the following message: Paper mismatch (using the same paper as before)and within a few seconds requesting to CANCEL, this stops the process  ???

  • Font changes when converting MSWord to PDF

    Sometimes when I convert a MSWord documents to a PDF, the font changes slightly on pages where there Figures.  The font appears to be in bold. How can I convert to a PDF and achieve a uniform look for the font throughout my documents? I used MS Word

  • FRAMEMAKER AND THE DTD

    I am trying to open an SGML file it says can't find the dtd. The file is in the same folder with the sgml file?

  • Third-party plugins and color cast

    Hello, When using DE:Noise or Magic Bullet Denoiser 2, I get a color cast on the whole image when it is applied simultaneously with a color correction via a Lumetri effect. I have tried everything inside Premiere regarding effect order, nesting, and

  • Multiple libraries iTunes and iPhoto

    Probably this is an item that Apple has to resove, but just put this remark in public as some people did before by addressing the problem. I love to use iTunes and iPhoto, but the most irritating failure of the program is that it has no possibillitie