How to give default as empty  to save as filename

Hi all,
I need to open a excel file on the browser.User has to enter his own filename for Save As-> Filename.
It is opening successfully.
while trying to Save As (file->Save As) for filename it is giving like this "quotes.csv?s=%5EIXIC&f=sl1d1t1c1ohgv&e=.xls"
but I have to give(default) empty space for filename (after opening the excel on the browser tyring to Save As filename)
this is the problem to give empty space(default) for filename for Save AS.
My code is in struts action
<b>
public ActionForward execute(ActionMapping mapping, ActionForm form,
               HttpServletRequest request, HttpServletResponse response)
               throws Exception {
          // getting data from JSP
          String columns = request.getParameter("columns");
          String searchString = request.getParameter("searchstring");
          String srchType = request.getParameter("searchType");
          System.out.println(" Action columns:  "+columns);
          System.out.println("Action searchString:  "+searchString);
          System.out.println("Action srchType:  "+srchType);
          String filename = null;
          try {
               //getting servlet context for absolute path
               ServletContext context = getServlet().getServletContext();
               //creating object for dao
               RegistrationMigrationDAO dao = new RegistrationMigrationDAO();
               //getting file path from dao
               filename = dao.migrateregistration(columns, searchString, srchType,
                         request, context, getServlet().getServletName());
               //System.out.println("url in action: " + filename);
               //setting mime type
               response.setContentType("application/vnd.ms-excel");
               //setting the header
               //response.setHeader("Content-Disposition", "attachment; filename="+ filename);
               //creating fileinputstream object to open the file
               FileInputStream fis = new FileInputStream(filename);
               //passing FIS object to work book to open in the form of spread sheet
               HSSFWorkbook book = new HSSFWorkbook(fis);
               //creating object for outputstream to disply
               OutputStream out = response.getOutputStream();
               book.write(out);
               //closing the outputstream
               out.close();
          } catch (Exception e) {
               e.printStackTrace();
          return null;
</b>
by using this
<b>//response.setHeader("Content-Disposition", "attachment; filename="+ filename);</b>
I am getting but excel is not opening on the browser separately excel file opening (not on the browser separate window as excel). I want open excel on same window(browser) and for Save As-> Filename as empty.
this is the thing I have to do.
Give  me solution to give saveas filename as empty after opening the excel on the browser.
<b>User has to enter his own filename it is allowing but I ahve to give filename default as empty space.</b>
Thanks in advance
Rama Krishna

Hi,
try
response.setHeader("Content-Disposition", "inline; filename="+ filename);
This should force your browser to open the file in the same window.
And I had the problem with empty file name in save as, too. For our purposes, it helped to shorten the filename. But as I was told this depends on IE and OS versions.
Regards, Astrid

Similar Messages

  • How to set default file path for save

    Hello all,
    I'm currently blocked on the below issue and is hoping to gain your help and insights.
    We have recently upgraded to InDesign CS6. Now when an INDD file created in an older version of INDD is opened in CS6, all the save dialogs would not default to the location of the original INDD file. Though if the same file is opened in the version of InDesign that created it, the save dialog goes to the proper location by default.
    Debugged using our custom plugin as a gate way, and found out that after InDesign CS6 performed the document upgrade/convert, the database for the converted document loses file information. i.e.  IDataBase::GetSysFile() returns nil. I think we can figure out some way to get the original file path. For example, we can intercept "kAfterOpenDocSignalResponderService", and get the original file path of the opened file from IDocumentSignalData. Though I haven't yet able to figure out a safe way to set this file path to the document, so that the save dialogs would by default point at this path.
    Utils<Facade::IWorkgroupFacade>()->InitDocumentAssetManagement(docRef, filePath) seems to do the right thing, but it seems to be quite intruding, and I'm afraid that it is overkilling and will cause bad side effect for the use case I'm looking for.
    So I'm wondering if anyone has any suggestions to achieve this without implementing/overriding the file save dialog.
    Thanks.
    -Jeff

    You should be able to avoid writing your own open-doc trap by using kDocBoss's IOpenedFileInfo to obtain the original file's path. It seems fairly reliable; the only time I've seen it come up empty is for an opened QuarkXPress document.
    I'm afraid I don't know of a sanctioned way to change IDataBase::GetSysFile() without going through the database's SaveAs machinery. Overriding this behavior might only be possible by replacing the regular Save dialog with your own.
    But if InitDocumentAssetManagement() is helping, maybe the workgroup/asset management approach is worth pursuing. Have you tried spying on that call in the debug app? You might be able to isolate and use one of the commands that it's invoking (IAMSPManager::BindAsset() / kSetAssetAttributesCmdBoss?) without all of the side-effects of the higher-level call.

  • How to change default save as location

    hi,
    how to change default save as location in acrobat 7.0?

    Why is Acrobat involved in this process at all? Why don't you save directly the pdf from your email program directly where you want it to be? Acrobat is just adding another step to this process.

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • Suddenly my PS CS5 defaulted its "Save As" to JPEG2000, how do I restore it back to "Save As" JPEG?

    I got a new computer (Windows 7) at work this April and as of today, when I work on any of my JPEG images in PS CS5, suddenly it has defaulted its "Save As" to JPEG2000. How did this default change and how do I get it to default save as. JPEG again? There was nothing I noticed and no warning as to why this has changed, I didn't touch a thing!
    (Last week, Adobe had to work with our IT manager to fix a problem that started occuring with my new Adobe Acrobat Pro 11 program. They had to log into my computer and change a registry thing to get it to work properly again...also something that changed without warning!!)

    Thank you Curt Y, as I saw your post reply come through, I had just hung up with Adobe support (after being on the phone for an hour & a half).
    To be clear...prior to today, if I opened a JPG file, and did an immediate "save/save as", it would automatically re-save as a JPG file but it seemed to suddenly be defaulting to a "save/save as" JPEG2000.
    They claimed that yes, there was a fix for this and while I was on hold she had me follow a few directions which DID fix the issue. While we were on the phone she was able to have me restore it to at least a default "save/save as" for a PSD file rather than a JPEG2000, which is better than nothing and she was about to help me get the default set so that when I open a JPG it would automatically default to "save/save as" a JPG, but she couldn't get it that to work. After she logged on to my computer to physically do it herself and failed to fix it further, she thinks my security permissions (we are on a network) are not set properly and she wanted to create a new user account with the proper permissions but we were halted because our IT guy is not in right now.
    She gave me a case# and when he returns tomorrow, we are to try her list of instructions starting with creating a new (PS CS5 user account) then if that does not restore the "save as" defaults we are to uninstall, then re-install PS. If this still does not work we are to call her back and they will try to fix it from there. She did tell me that in my version of PS (CS5), she was able to open a JPG (on her end), then hit save as, and it defaults to saving as a JPG, not a PSD as is happening to me.
    Before I posted here, I did do an iternet search to find out how to set the defaults, however I too found that everyone says there is no such default of a "save as" JPG...but Adobe claims otherwise. We shall see what happens tomorrow...

  • How to make default value of property "empty" with label "- Select -"?

    Hi,
    Is it possible to make the default value empty/null/blank, when one creates a new property in KM > CM > Global Services > Property Metadata > Properties?
    If I leave the default value blank, the dropdown menu turns empty, when the corresponding XML form uses the property. So how do I get around this problem?
    Regards,
    Martin

    Anyone?
    I guess the answer is not as simple as the question?

  • When I try to download a program, the pop-up only gives me the option to "save" the program, instead of giving me the option to "run" the program. How do I fix this?

    I have tried downloading iTunes (and Quicktime), but instead of giving me the option to "run" the program, Firefox only gives me the option to "save" the program (which I already tried, does not work to give me access to the downloaded program). Is there a setting I need to change?

    That's intentional, because running exe files from your browser is a major security concern. You can run the file after you have downloaded it. If you don't know where it is on your computer, go to '''Tools > Downloads''', and double-click on it from the Downloads window.

  • How  to change default window size?

    I'm using MX 6.0 on Mac... For some reason I can't figure out
    how to change the default window size in the work windows. Every
    time I open a new file to work on it opens to a smaller size than
    the actual page is. When opening pages dozens of times a day, it
    gets annoying to have to resize each time. I'm sure it wasn't
    always like this, but I can't figure out how to change it so the
    default size that it opens to each time is larger.
    Thanks for any help,
    DD

    Window | Workspace | Save Current
    This gives you the opportunity to save a current layout look
    that you like
    You might also look under
    Edit |Preferences | Status bar - but I don't see that this
    does anything
    in DWCS3

  • BEx Analyzer - Workbook - How to give a title.

    How to give a title for a field which shows both Key and text in the Workbook. Generally we have the title for the key column but how to give a title name for the text column in the workbook.Please Advise.

    Hi ,
    I suppose you cannot save the macros (written by you) in BexAnalyzer.xla as that is the standard interface provided. When you write some macros related with workbook and want it to be executed each time you refersh. You can do that by providing the macros name in execute macro on each refresh under  Workbook properties tab in Bex design toolbar. or you can write that macros code under default workbook in VB editor under your VBA project related to your workbook.
    hope it helps
    with regards
    Rohit Gupta

  • How can I pass an empty array to a parameter of type PLSQLAssociativeArray

    How can I pass an empty array to a parameter of type PLSQLAssociativeArray in VB? I defined the parameter like this
    Dim myArray() as String = new String() {}
    Dim myPara as new Oracle.DataAccess.Client.OracleCollectionType.PLSQLAssociativeArray
    myPara = 0
    myPara.Value = myArray
    When I execute my stored procedure giving the above parameter, I got error saying OracleParameter.Value is invalid.
    I have tried to give it the DBNull.Value, but it doesn't work either.
    Note: everything works fine as long as myArray has some item in there. I just wonder how I can make it works in case I have nothing.
    Thank you,

    How can I pass an empty array to a parameter of type PLSQLAssociativeArray in VB? I defined the parameter like this
    Dim myArray() as String = new String() {}
    Dim myPara as new Oracle.DataAccess.Client.OracleCollectionType.PLSQLAssociativeArray
    myPara = 0
    myPara.Value = myArray
    When I execute my stored procedure giving the above parameter, I got error saying OracleParameter.Value is invalid.
    I have tried to give it the DBNull.Value, but it doesn't work either.
    Note: everything works fine as long as myArray has some item in there. I just wonder how I can make it works in case I have nothing.
    Thank you,

  • How to give no of lines per page in alv report

    hi
    could anybody tell me
    how to give no of lines per page in alv report
    i need bottom of page too
    if possible plz send the code too
    it ll be very helpful to me
    thanx
    kals.

    Hi,
    This is possible, using some of the events in the ALV.
    You could use AFTER_LINE_OUTPUT event and call you form after say, a certain line count is reached on the list output.
      MOVE 'AFTER_LINE_OUTPUT' TO gw_event-name.
      MOVE 'AFTER_LINE_OUTPUT' TO gw_event-form.
      APPEND gw_event TO gt_events.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                it_events                = gt_events[]
    and define the form for each event as follows - this would be a dynamic call by the ALV.
    *&      Form  after_line_output
    *       Form for the After Line Output Event in the internal table
    *      --> rs_lineinfo
    FORM after_line_output USING rs_lineinfo TYPE slis_lineinfo.
      IF sy-linno eq v_linno.          "Defaulted value for line count
        perform write_footer.
        NEW-PAGE.
      ENDIF.
    ENDFORM.                    " after_line_output
    For lines per page:
    rs_lineinfo-tabindex would give you the index of the current line in the list, which you could use to read the t_outtab table, and reduce the line count of items displayed on the earlier page.
    There are a few other events too, like BEFORE_LINE_OUTPUT and END_OF_LIST which you can use as required and print the data.
    Regards,
    Anil.

  • How to populate default values for BP (FPP1 is  tcode in ECC 6.0)

    Hello ,
    I am creating BP in ECC 6.0 using Fpp1 tcode.  How to populate default values when i hit create BP person.   any badi  triggers when we are creating BP in ECC.
    guide me.

    Hi Premanand,
    To default fields, you need to do the following steps :
    1. Create a Z module e.g. : Z_DEFAULT_FIELDS_DIALOG.
    2. Enter suppose you want to default fiels Name, title, country, write code as follows  :
    DATA : ls_busdefault LIKE busdefault.     
      ls_busdefault-title = '0002'.
      ls_busdefault-mc_name1 = 'TEST'.
      ls_busdefault-mc_name2 = 'Default'.
      ls_busdefault-country = 'IN'.
        CALL FUNCTION 'BUP_BUPA_FIELDVALUES_SET'
        EXPORTING
          i_busdefault = ls_busdefalut.
    3. Now got to transaction BUS7, select event ISDAT, click on Event--> function modules.
    4. Register your Z module Z_DEFAULT_FIELDS_DIALOG in this list, Save.
    This should solve your problem. Please note : You can only default those fields contained in structure BUSDEFAULT.
    Cheers,
    Rishu.

  • How to give ** bydefault in password in module pool screen .

    Hi experts
    how to give  *******  by default in password in module pool screen .
    Thanks

    Hi ,
        Double click on the field u will get a pop up window
        i.e. attribute window for that field.
        in that window you have a tab called Program at the bottom.
       in program tab you have many checkboxes.
      check the check box with name *Entry.
      and activate.
    what ever you enter now will be in password formate
    Regards
    Ajay

  • How to give other material as a free good

    Hi all,
    Here i am getting doubt how to give free good for one material to another material. for ex:- if customer buy product A he will get product B as a free good how do we configure in to sap. i tried in exclusive method in the sales order it is executing and when coming to delivery and billing free good line item is not getting in deliveries and billing how to do this. plz tell the required steps to do this.
    Thanks & Regards,
    kishore

    Hi,
    This can be done in two ways.
    1)Create a BOM with the product A as the header material.Make sure that the sub items are for free of cost.Pricing will be done only for this header.
    2)Mainatin the different item category for both material A and material B.
    Goto VOV7 T.Code.
    Select material B's item category.
    Details.
    Maintain the pricing as "B".
    Save.
    Regards,
    Krishna.

  • I use an external hard drive as a Time Machine back up, but I want to use another external hard drive to save movies, photos on it, but it won't give me the option to save anything on the new external hard drive. Nothing is wrong with the external hard.

    I use an external hard drive as a Time Machine back up, but I want to use another external hard drive to save movies, photos on it, but it won't give me the option to save anything on the new external hard drive. Nothing is wrong with the external hard. 

    Hi Clarkett99,
    To use an external hard drive for your iTunes library, see the steps in this article -
    iTunes: Back up your iTunes library by copying to an external hard drive
    http://support.apple.com/kb/HT1751
    iPhoto can be used in a similar way, follow the steps in this previous discussion -
    how do I save photos and their albums...: Apple Support Communities
    https://discussions.apple.com/thread/3744259
    Thanks for using Apple Support Communities.
    Best,
    Brett L

Maybe you are looking for

  • Repost-- Facing Problems while installation of SAP NW PT 7.0 on Oracle 10.2

    Hello Friend, Sorry Friends, for my last long.....long...Post..... Here , i m reposting the same matter...Please help. We are trying to Install SAP NW PI 7.0 on Windows 2003 Server Enterprise Edition x64, with Oracle 10.2 - 64bit Edition. On this hos

  • Errors during VM migration

    Hi, I have an SCVMM 2012 R2 instance (with CU1), and when I perform a VM migration I get a status of Completed w/ Info In the details pane of the Jobs window I have 9 errors and a warning every time Error 23801 - No available connection to selected V

  • Menu Bar goes missing when I close a page/program?

    I am using a 13 MBA 2013 and whenever I close the browser of app store, iPhoto etc, the top menu bar dissapears until I click on the wallpaper at the desktop. Any ideas?

  • Printing problems, can anyone help? i feel so lost

    I upgraded to tiger then the automatic software update took it up to 10.4.3 everything seemed fine til i tried to print on my trusty canon s330 printer...i just couldnt locate a driver for it so i clicked on any of the ones in the pop up in printer s

  • How to install software from download

    I'm new to the mac world. I'm using move2mac to move files over from pc. I downloaded and installed the software to my pc, but when I download the software for mac the install comes out in a weird format. (pkg.html)?