Need to specify default filename for SaveAs

I am using the command app.execMenuItem("SaveAs"); in the click event of a button. Is there anyway that I can specify a default filename for the user? I do want the user to get the Save As window and the ability to change the name if possible.
The form is generated by the RenderForm Java script, and the name being generated as a default for the SaveAs window is RenderForm.pdf
Thanks,
Velvet

Chris, I think you missed this one.
I think you want to change the name when calling app.SaveAs via javascript from the client not on the server. Since app.executeMenuItem("saveAs") will not take any parameters to suggest a file name. I think you will have to use doc.saveAs which will allow the name to be specified. This would require a trustedFunction which may or will not work unless you have known users. You will also need to prompt for the file name before making the call.
Here is some untested code to get you started...
You will need to create a trustedFunction (see AcroJS.pdf for details) ..
saveFunc = app.trustedFunction(function (filename) {
app.beginPriv();
try {
event.target.saveAs({cPath: filename});
} catch (err) {
app.alert("Error: " + err);
app.endPriv();
Code for your event...
var suggestedName = "MyPDFName.pdf";
// Note This will only work if you know where they will be saving it
var cPathToSaveTo = "/c/temp/";
var cResponse = app.response({
cQuestion: "What name would you like to use for this PDF?",
cTitle: "File Name",
cDefault: suggestedName,
cLabel: "File Name:" })
if(cResponse != null)
saveFunc(cPathToSaveTo + cResponse );
Hope this helps.
Rich Ruiz
Novanis

Similar Messages

  • Getting error while creating form and report on webservice: ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.

    i am using the following description to create a web service reference:
    web reference :REST
    Name :Yahoo Map
    URL :http://local.yahooapis.com/MapsService/V1/mapImage
    HTTP Method: GET
    Basic Authentication: No
    Add Parameter:
    Name       Type
    appid        String
    location    String
    Output Format: XML
    XPath to Output Parameters : /Result
    Output Parameter:
    Name       Path       Type
    Url          /text()      String
    Then i tried to create form and report on webservice:
    Web Service Reference Type: Yahoo Map
    Operation: doREST
    All the fields i keep as default
    I tick the checkbox (url)in report Parameter
    After clicking next whereever required i click create button
    I get the following error
    ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
    Please someone help to solve this as i need to fix it urgently.

    i exported the application from apex.oracle.com and imported it to our environment
    import went fine, but when I ran the IR page I got
    ORA-20001: get_dbms_sql_cursor error ORA-00904: : invalid identifier
    evidently the problem is a lack of public execute on DBMS_LOB, which is used in the generated IR source.
    while waiting for the DBA to grant privs on DBMS_LOB, changing the dbms_lob.getlength call to length() fixes the IR.
    however, i am not getting the download link on the associated form page... changed templates, that's not the issue -- we'll see if that's a dbms_lob issue as well

  • APEX:Getting error while creating form and report on webservice: ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.

    I am using Apex 4.2.2.00.11
    am using the following description to create a web service reference:
    web reference :REST
    Name :Yahoo Map
    URL :http://local.yahooapis.com/MapsService/V1/mapImage
    HTTP Method: GET
    Basic Authentication: No
    Add Parameter:
    Name       Type
    appid        String
    location    String
    Output Format: XML
    XPath to Output Parameters : /Result
    Output Parameter:
    Name       Path       Type
    Url          /text()      String
    Then i tried to create form and report on webservice:
    Web Service Reference Type: Yahoo Map
    Operation: doREST
    All the fields i keep as default
    I tick the checkbox (url)in report Parameter
    After clicking next whereever required i click create button
    I get the following error
    ORA-20001: Unable to create form on table. ORA-02263: need to specify the datatype for this column.
    Please someone help to solve this as i need to fix it urgently.

    336554,
    Looks like there is a 127-column limit on the number of report columns supported when using that wizard. Do you have more than that?
    57434

  • How to set default preset for Save for Web

    Following the demise of my laptop, I have installed PSE8 (Windows) on my new one.
    On my old machine, the default preset for Save for Web was JPEG High
    On the new installation, the default is GIF and you have to manually scroll through the presets every time to apply the JPEG High preset.
    Is it possible to change the default preset.  If so, how.
    Thank you

    That faq from John R Ellis has not been updated, but may be useful:
    Photoshop Elements 6/7/8 Frequently Asked Questions (FAQ)

  • Need to set default values for the fields plant and location in ME21N

    Hi All,
    i need to set default values for the fields plant and location in ME21N tcode.
    In accout assignment if we give 'A' then we need to create asset by clicking the Asset tab,there you have the fields plant and location.
    How to resolve this?
    Thanks in Advance

    hi .
    i needed to set default strorage location and plant in personal setting  in me21n.
    i solve it with this way.
    go to program SAPLMEPERS in se38.
    create new function in output with the sample name :MODULE ZTEST_001 OUTPUT.
    in this module write:
    if MEPOITEM_PROP-WERKS is INITIAL and  MEPOITEM_PROP-LGORT is INITIAL.
    MEPOITEM_PROP-WERKS = '1000'.
    MEPOITEM_PROP-LGORT = '0032'.
    endif.
    this is the solution.
    best regards.
    maryam

  • Set default filename for file save dialog

    Hi,
    I am using AxAcroPDF control to view pdf files in windows forms.
    Is there any option to set the default filename in the save dialog?
    Thanks for your help.
    Freedon

    Hi,
    I've found a solution.
    public void Open(string filePath)
    axAcroPDF.LoadFile(filePath);
    //this will set the correct name in the save file dialog.
    axAcroPDF.src = filePath;
    Thanks for your help.
    Freedon

  • Set default filename for file save dialog on Save button click

    Hi,
    I am using AxAcroPDF (version 9.0) control to view pdf files in windows forms (C#). The pdf loads into the viewer in the form. Now, when I click on the Save button in the viewer, a Save dialog pops up with a default filename having complete path info.
    If I have loaded the pdf file into AxAcroPDF viewer with filename:
    "C:\Documents and Settings\KB_Kravi\My Documents\CustomerList.pdf"
    then in the save dialog, the default filename will be:
    "C_Documents_and_Settings_KB_Kravi_My Documents_CustomerList.pdf"
    Is there any option to set the default filename in the save dialog to some short name, instead of this lengthy name?
    Thanks,
    Ravi.

    Hi,
    I've found a solution.
    public void Open(string filePath)
    axAcroPDF.LoadFile(filePath);
    //this will set the correct name in the save file dialog.
    axAcroPDF.src = filePath;
    Thanks for your help.
    Freedon

  • Default filename for print to file in Linux

    Hi,
    I'm using print to file in Linux, and I'd like the default filename to be the page title. I couldn't find a config option for this. It retains the last file name I used, which is very problematic for me, as I can easily overwrite my last printed file by accident.
    I'd also like the printer to default to print to file. Is that possible? Not a big deal, but it would save me a click. :-)
    BTW, I've found that the print to file for PDFs is excellent. It often produces PDFs that half the size of other options I've tried. Thank you!
    Ari

    This is not solved as I do not know where to change the default directory.

  • Setting default filename for servlet-based download

    I'm new to servlet programming and am attempting to download a file from the server to the client. When I am prompted to open the file from it's current location or save it to disk, the correct filename appears. However, when I click ok and the Save dialog appears, the default filename isn't the actual name of the file but instead contains the name of the package the servlet is located in. Can anyone tell me how I can change my code to have the default filename appear instead of the package name. Thanks.
    Here is the code to call the servlet located in the package named 'frosttwo':
    WebgapBeanFactory wgbf = WebgapBeanFactory.getWebgapBeanFactory();
    String path = wgbf.getTransferFileDirectory();
    String filename = path + request.getParameter("file");
    System.out.println(filename);
    response.sendRedirect("/servlet/frosttwo.Servlet1?file=" + filename);
    Here is the code contained in the servlet:
    public class Servlet1 extends HttpServlet {
    private static final String CONTENT_TYPE = "text/html";
    /**Initialize global variables*/
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    /**Process the HTTP Get request*/
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    String file = null;
    try
    file = URLDecoder.decode(request.getParameter("file"));
    String filename = file.substring((file.lastIndexOf(File.separatorChar) + 1), file.length());
    response.setContentType("application/octet-stream");
    response.setHeader("Content-disposition", "attachment;filename=" + filename);
    File f = new File(file);
    FileInputStream is = new FileInputStream(f);
    ServletOutputStream s = response.getOutputStream();
    byte[] buffer=new byte[8192];
    int length=buffer.length;
    while((length=is.read(buffer))!=-1)
    s.write(buffer,0,length);
    s.flush();
    catch (IOException ex)
    System.err.println("There was an error sending file " + file);
    ex.printStackTrace();
    catch (Exception ex)
    System.err.println("There was an error sending file " + file);
    ex.printStackTrace();
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    doGet(request, response);
    /**Clean up resources*/
    public void destroy() {
    Thanks again.

    I use something like this for res.setHeader and it works fine for me. In the save dialog box it puts this filename there. But if its not able to find the filename then sometime it used to put servletname instead of filename:
    res.setHeader("Content-Disposition","multi-part attachment;filename=\""+
    fname+"\";");
    hope it helps
    vinod

  • Can I set a default folder for "save as"?

    Hello,
    I opened a pdf file attachment to an email by double-clicking it. When I wanted to save the file using File/Save As... , the folder/directory shown was the location where MS Outlook placed the attachment.
    I am using Acrobat Reader XI (latest version) on a Windows 7 64bit PC. I could not find any method to change this default behavior of Save As.
    Is it possible to change the behavior of the Save As function to use one or more of the following:
    a fixed user-defined folder/directory
    the last folder/directory used for the Save As dialog (which should be displayed with the full path) !
    the same location where the currently open file was opened (this is the current & only behavior)
    It would be most useful if the default  behavior could be selected among these options in the Edit/Preferences... dialog. Additionally, in the Save As dialog these same options should be displayed with the default selected, thus giving the user the ability to change the behavior for a specific Save As operation.
    If there is no way to do this (e.g.. with an "undocumented" feature or command-line switch), would Adobe consider implementing this?
    Thank you!

    apparently Adobe doesn't give a sh!t about it's users. The possibility to change default behaviour has been removed with the introduction of version 10 and hasn't come back since. For over 3 years people are complaining about this on the forum and are being offered poor workarounds (create a shortcut in your temp folder pointing to your desktop? for fck sake!)
    Adobe employees will tell you 'default system behaviour' ******** and basicly tell u to go finger ur bu.thole.
    I use to buy their products (adobe creative suite) but the fact they don't give 2 sh!ts about their customers made me pick another vendor.
    Best solution i can offer u is just use ANY of the 10.000 other freeware utilities that do offer the basic functionality u'd expect.

  • Default Filename for a New Pages Document

    When I collect articles from the web and save them in Word or Beans, the file name defaults to the first line (title) of the document. When I save a new document in Pages, the default file name is Untitled. Is there a way to make Pages use the first line of a new document as the default filename?
    This is very useful as the Save Dialog box sits right over the top of the document where the Title is displayed.
    If this feature is not yet available, what is a good work around?

    This script achieves your goal.
    --[SCRIPT saveAs1stParagraph]
    Enregistrer le script en tant que Script : saveAs1stParagraph.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
    Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
    Copier la chaîne de caractères à utiliser comme nom du document.
    menu Scripts > Pages > saveAs1stParagraph
    Le script ouvre le dialogue "Enregistrer sous …" et y colle le nom retenu.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    --=====
    Save the script as a Script: saveAs1stParagraph.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
    Maybe you would have to create the folder Pages and even the folder Applications by yourself.
    Copy the string to use as filename.
    menu Scripts > Pages > saveAs1stParagraph
    The script opens the "Save As…" dialog and paste the selected name in the target field.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2010/05/18
    --=====
    property theApp : "Pages"
    --=====
    on run
    set the clipboard to paragraph 1 of (the clipboard as text)
    my raccourci(theApp, "s", "cs") (* Save as… *)
    my raccourci(theApp, "v", "c") (* Paste *)
    end run
    --=====
    on activateGUIscripting()
    tell application "System Events"
    if not (UI elements enabled) then set (UI elements enabled) to true (* to be sure than GUI scripting will be active *)
    end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
    It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
    I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
    on raccourci(a, t, d)
    local k
    tell application a to activate
    tell application "System Events" to tell application process a
    set frontmost to true
    try
    t * 1
    if d is "" then
    key code t
    else if d is "c" then
    key code t using {command down}
    else if d is "a" then
    key code t using {option down}
    else if d is "k" then
    key code t using {control down}
    else if d is "s" then
    key code t using {shift down}
    else if d is in {"ac", "ca"} then
    key code t using {command down, option down}
    else if d is in {"as", "sa"} then
    key code t using {shift down, option down}
    else if d is in {"sc", "cs"} then
    key code t using {command down, shift down}
    else if d is in {"kc", "ck"} then
    key code t using {command down, control down}
    else if d is in {"ks", "sk"} then
    key code t using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    key code t using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    key code t using {command down, shift down, option down}
    end if
    on error
    repeat with k in t
    if d is "" then
    keystroke (k as text)
    else if d is "c" then
    keystroke (k as text) using {command down}
    else if d is "a" then
    keystroke k using {option down}
    else if d is "k" then
    keystroke (k as text) using {control down}
    else if d is "s" then
    keystroke k using {shift down}
    else if d is in {"ac", "ca"} then
    keystroke (k as text) using {command down, option down}
    else if d is in {"as", "sa"} then
    keystroke (k as text) using {shift down, option down}
    else if d is in {"sc", "cs"} then
    keystroke (k as text) using {command down, shift down}
    else if d is in {"kc", "ck"} then
    keystroke (k as text) using {command down, control down}
    else if d is in {"ks", "sk"} then
    keystroke (k as text) using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    keystroke (k as text) using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    keystroke (k as text) using {command down, shift down, option down}
    end if
    end repeat
    end try
    end tell
    end raccourci
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) mardi 18 mai 2010 15:48:40

  • Don't want iCloud as default destination for Saves.

    Since the introduction of iCloud, some of my apps, such as Pages and TextEdit, insist on using iCloud as the default destination for saving a document-- which is something I almost never do. (I like keeping my documents on my hard drive, not on Apple's remote servers, thank you very much.)
    This new behavior is annoying, because formerly I could depend on my Save windows to point to the folders I'd previously saved to, so I didn't have to keep navigating back to them. Also, because now the Save windows are collapsed by default, I first have to choose a destination other than iCloud by pressing the disclosure button, then wait for the full Save window to open before I can go to the folder I want.
    This is not an improvement, nor a convenience. It is a pain in the ***.
    Is anybody aware of a way to return to the previous state of affairs?

    Oooo !
    Just found this on another discussion page:
    http://hints.macworld.com/article.php?story=20120820003211714
    haven't tried it yet butit may be THE ANSWER
    Shame that one has to start tinkering in Terminal to do something quite simple.
    Like having to lift the car bonnet to change gear !

  • Do I need to specify VRF management for NX5020 management config?

    I have a isolated NX5020 that only connects servers to storage controllers. It doesn't have any data traffic going into the network. The only connectivity to the network is through mgmt0 port. In this case, when I configure management functions such as DNS, SNMP, syslog, NTP, TACACS, AAA, etc. do I always need to specify "vrf management"?
    I just want to make sure the management traffic can get to their servers on the network through mgmt0 port.
    Thanks

    You will need to specify VRF Managment as the mgmt0 interface is tied to that VRF.
    Now if you want this traffic to get pass through to servers, you will need to add another port thats in the same VRF as your servers and uplink that to your network.  Traffic going to mgmt0 will only get to the switch, it won't get passed through to any other port.

  • Specifying Filename for SaveAs Dialog

    There are lots of threads out there about creating JavaScript to create a unique filename and then automatically save the file with a button click. However, I have a simpiler question. I don't want to automatically save. I want the button to open the SaveAs dialog just like with app.execMenuItem("SaveAs"). However, I would like to know if I can set the filename that would appear by default.
    I want the user to have the option of changing the file name, path, etc. with the dialog, but I do not want the current file name of the form to be the default that comes up. The form is too easily overwritten.
    As an aside, I tried making the file read only. The result is that the file remains unchanged, but the SaveAs dialog displays no error message and acts like it saved the file.
    Any ideas? Thanks for the help.

    Not possible with JavaScript.

  • How do i specify the filename for a binary file generated by a JSP?

    I am writing a report generator that has the ability to generate Excel files. The user clicks on a link (exporter.jsp), the page's content-type has been set to "application/vnd.ms-excel" which naturally prompts the user to either save to a file or open directly in Excel.
    It works fine, but requires the user to manually rename the generated file from "exporter.jsp" to "whatever.xls". Furthermore, Firefox will not let you rename the file in save dialog box, it just automatically saves the file as "exporter.jsp", you must rename it from the file browser.
    How do specify the output file name from within JSP?
    Btw, right clicking and selecting "save link as" allows for specifying the file name, but the file that is created is empty.
    Thanks

    You need to set the content-disposition header as well as the content-type.
    here is one article on the subject
    res.setContentType("application/vnd.ms-excel");
    res.setHeader("Content-Disposition", "attachment; filename=" + filename);

Maybe you are looking for