How to save data in html format while user click a save button in jsp page

Hi All,
I have the following requirement
If user click on the Save Button it should display a window which allows the user to select the directory and the data is stored in the Internet Explorer Format.
Could please anybody suggest me how to impletment the above requirment in jsp page.
It's very urgent. Please replay ASAP.
Thanks
Rajeshwari

Analyzing ur ques ...
If user click on the Save Button it should display a window which allows the user to select the directory and the data is stored in the Internet Explorer Format.hmmm..
There is no html object type which supports directory selection for download. There is only an input type="file" which however is related to an upload scenario.
By downloading the file using output stream u can achieve what you want.
You simply need to do the following things ..
a) Write to an output stream
b) Set the content type to "text/html" for your response
Example ....
response.setContentType("text/html");
response.setHeader("Content-disposition",
"attachment; filename" +
"Example.html" );
javax.servlet.ServletOutputStream stream = res.getOutputStream();
StringBuffer text = new StringBuffer(1024);
text.append("some text . . . ");
text.append("more text . . . ");
stream.write(data);
stream.close();

Similar Messages

  • How to show the data in table format when user click the Graph

    Hi,
    I have a graph in my report. If user click the graph is there a way to show
    the data behind it?
    Thanks.
    Regards,
    Jun

    Hi All,
    Any idea how to do this?
    Thanks.
    Jun

  • Issue of data getting wiped out when user clicks on back button..

    Hello Gurus,
    I have a selection program which displays ALV on execution. Now I have programmed the "Back" Button of standard toolbar so that when comeone clicks on it, it should leave to selection screen.
    WHEN 'TBACK'.
          LEAVE TO TRANSACTION SY-TCODE.
    But when I do that, the values entered by user during execution of selection screen wipes out and all the selection fields become empty. How can I make sure that when sure clicks on 'Back' button, the selectiuon screen is presented but with values in which user put during execution.
    Regards,
    Rajesh.

    Hi Rajesh ,
    Leave to transaction sy-tcode is as as good as call transaction...so basically using this statement will start the transaction afresh..and give a new selection screen....
    Better option would be to leave to screen 0 (preferaby used for a report )which will take you back to the previous screen processed or leave to screen XXXX for a particular screen( in case of a module pool )
    Hope it helps
    Regards
    Byju

  • How to sort data in descending order when user clicks on the column heading

    Hi
    I have a report called "Top customers", which shows the top customers for a specific product line. It displays the customer name and one column with the total amount spent in the period for each product line. By default, the leftmost product line is sorted in descending order.
    If the user wants to know who are the top customers for another product line, they simply click on the column heading to sort the list by that column.
    The problem is that when you click for the first time on a sortable column heading, Apex sorts it in ascending order; you need to click on the same column heading again to sort in descending order.
    Is it possible to change this behaviour and sort the data in descending order in the first click? So the users don't have to click twice...
    Thanks
    Luis
    PS: Apex 3 running on Oracle 10.2.0

    Luis,
    See: Can I "catch" a click on a sortable column header of a report?
    Take a look at Anton Nielsen's answer with regards to hiding a column and displaying its value instead of the sortable column.
    Asumming the following simple report query:
    select product,sales
    from <table>
    Change that into:
    select product
    ,sales*-1 as reverse_sales -- Select this one as an extra column
    ,sales -- Hide this column
    from <table>
    In your report column attributes (of column reverse_sales), html-expression, type #sales#. It then displays the normal sales. However apex will generate a 'order by 2 asc' for the first time. The '2' will refer to the sales*-1 value: sorting it asc, is the same as sorting sales descending...
    Toon

  • How to get the values retained on clicking the back button in jsp page

    Hi All,
    I had two jsp's search and results. In the search page when i enter some values in the text fields, the rsults will be displayed for that search criteria. I had a back button in the results page. When i click on this back button i will get back to my search page. I am using the following code for this back button.
    <INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1)" class="button">
    Now the problem is when i get back to search page using this back button, i am not able to get the values in the search page which i entered, i am getting all blank values. What should i change to get these values back in the search page. Should i maintain any sessions for this?

    You have no control at all over the back button process. To the server, it's indistinguishable from the user simply tying the URL of your search page. So, you need to store this data server side*.
    When your search page is submitted and processed, store the values you received for each of the fields into the user's session. Then, when the search page is generated, check the session for these values, and for any values that are not null, put their values into the html as the default values for the textboxes and controls you are using. This lets you handle the whole matter on the server's side.
    *barring convoluted, unportable, black-magic javascript trickery which you should definitely avoid                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to save diagramm in HTML format or PDF it

    how to save diagramm in HTML format or PDF it

    You have two alternatives. First of all, there are many utilities, some of them free that can put a "printer" on your printer list that really writes a PDF file. The one I use is free, called CutePDF. Once you have one of these installed, saving to PDF is as simple as print the diagram, choose the printer associated with your utility, then name the file.
    I'm not sure if it is in your version of Designer, but all of the latest versions of Designer have a "publish diagram" utility. Just drop down the Utilities menu from the RON or the Design Editor. The bottom selection should be "Publish Diagrams...", which will open a dialog window. Choose the diagram(s) you want to publish, select Publish to File, enter a file name, and select a graphics format from PNG, GIF, JPEG, BMP or TIFF. You can easily add the file to an HTML page inside an &lt;IMG&gt; tag.

  • Idoc-xi-file scenario.  how to display file in html format

    I am not sure whether this is a valid question.........but want to confirm as it was asked by somebody
    In idoc-xi-file scenario.......  how to display file in html format ??
    Thanks in advance
    Kumar

    Hi Vijayakumar,
    Thanks for your reply !! You mean to say I got to use XSLT mapping and also .htm and .html extension together to produce the html file ?? or it is sufficient to use any one of them to produce the html file ??
    Regards
    Kumar

  • How to convert date from ccyymm format to mmddyy

    hi,
    How to convert date from ccyymm format to mmddyy

    Please don't multipost. This question has been answered in your first post.
    How to convert date to ccyymm format
    Regards,
    Jo

  • How to convert date to ccyymm format

    Hi,
    How to convert date to ccyymm format.
    Thanks

    dadivela wrote:
    Re: How to convert date from ccyymm format to mmddyyI didn't inderstand. Date doesn't have any format. If you have a string in CCYYMM format, you would have to extract the YYMM from the string.
    SQL> SELECT   SYSDATE,
      2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
      3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM
      4    FROM   DUAL
      5  /
    SYSDATE   DATE_F YYMM
    08-JUN-09 210906 0906You can use this string to convert it to date. Note that since DD part of your date was not their in the resultan string, the converted date will fall back to first of the month specified.
    SQL> SELECT   SYSDATE,
      2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
      3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
      4           TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3), 'YYMM') conv_Dat
    e
      5    FROM   DUAL
      6  /
    SYSDATE   DATE_F YYMM             CONV_DATE
    08-JUN-09 210906 0906             01-JUN-09
    SQL>Then convert the date into the required format using TO_CHAR Function
    SQL> SELECT   SYSDATE,
      2           TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
      3           SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
      4           TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3),
      5                   'YYMM') conv_Date,
      6           TO_CHAR(TO_DATE(SUBSTR(TO_CHAR (SYSDATE, 'ccyymm'),3),
      7                   'YYMM'), 'MMDDYY') New_Format
      8    FROM   DUAL
      9  /
    SYSDATE   DATE_F YYMM             CONV_DATE NEW_FO
    08-JUN-09 210906 0906             01-JUN-09 060109
    SQL>Hope this helps.
    Regarads,
    Jo

  • How Adobe gets DATE and its format?

    Hello,
    I am getting current (todays) date by using below JS in some flds, and by using below FormCalc for some flds into my_form,
    JS:
    var currentTime = new Date()
    Form Calc:
    $.rawValue = num2date(date(), DateFmt(MM/DD/YYYY))
    But, i dont have much idea that how adobe is getting this date? For my company this is the very first form, hence they are asking me how adobe gets date and its format whether,
    1) From local IP/Interner provider address's date, format?
    2) or user PC/laptop's LOCAL settings date, format? if so, for example, if Germany user (Laptop settings) has a DD.MM.YYYY configured, if this user comes to US on a busines trip and if that user opens the form, then how the date looks like for this user? as per user laptop settings DD.MM.YYYY or local internat provider date format MM//DD//YYYY?
    Thank you

    Hi,
    the date() function returns the number of days since 01.01.1900 for the local date of the current system (related to the system clock of the OS).
    If you travel from Germany to the US but don't update your date/time settings, then it returns the same date in the US as in Germany.
    You can check the behavior by changing your local date/time setting or the timezones.

  • How to load data into html:select using Struts ?

    How to load data into <html:select> using Struts ?
    I can not load an array or collection (static or dynamic data) into drop down list control by <html:select /> Struts.
    please use:
    <html:select >
    <html:options />
    </html:select >
    Please help me. please detail it. thanks a lot.
    Message was edited by:
    tranminhman

    In order to load a collection or array of data you can use <html:select> with <html: options collection="" name=""/>
    here collection attribute refers to the Arraylist or Array of data and name is the name of the Form bean.
    Hope this helps...
    Chaitanya V

  • HT201406 1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc..

    1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc.. The cursor prompt is present.  Tapping screen just brings up the option to: "Select   Select All   Paste."   I have rebbooted with no change. 
    Message was edited by: Jimfromutah
    The problem was my connected bluetooth keyboard.

    1st. Gen iPad question:  the touch keyboard does not appear when attempting to input data into data fields - this happens while using all apps, ex. Notes, Google, Pages, etc.. The cursor prompt is present.  Tapping screen just brings up the option to: "Select   Select All   Paste."   I have rebbooted with no change. 
    Message was edited by: Jimfromutah
    The problem was my connected bluetooth keyboard.

  • How to cancelling email submission after user clicks "yes/no" button of message box?

    could some one tell me, how can i cancelling the submission event after one user clicks "yes/no" button of message box? The scenario is the following:
    After data input in a dynamic form clicks the user send mail button. Before the email submit, the user has to decide going back to the form and validate the input or continuing to submit email.
    In case of going back to validate input the submission event must not solve. So, how can i implemente it in java and/or form calc script?
    Thanks so much for your help in advance and i am very glad to hearing from you soon!
    Djinges

    Hello,
    The most easy way to solve your problem is to add two buttons, the first should be regular button and the second is submit by e-mail one. Set the
    'presence' property of the second to 'hidden' and add to it your email address. To the first button on 'click' event add the script like this
    form1.#subform[0].Button1::click - (JavaScript, client)
    var answer = xfa.host.messageBox("Send e-mail?","e-mail",2,1);
    if(answer==1){
    EmailSubmitButton1.execEvent('click');
    Hope this helps.

  • How do I call a method when the user clicks on the delete button?

    Hello , I need to implement the following :
    If date from is less than sysdate , when the user clicks the "delete" button , he is shown an error message .
    Can you please help how this can be done ? Thanks.

    Thanks. What are the steps for adding a custom delete button ?
    Are these ok ?
    1 ) Add an adf button
    2) Add the following in the actions listener : #{bindings.Delete.execute}
    3) Right Click button --> create method binding for action
    4) Compare date ?
    Thanks.

  • Insert a new value while the user clicks create insert button

    Hi,
    I am using jdev 11.1.5
    I had created a HD and ln Eo's with corresponding Vo's
    I had dragged and dropped as the master-detail relationship
    I had dragged and dropped the create insert button
    while i click the insert button
    The last value must be added by 1 and it should be inserted in the new row
    eg:
    JlNo      Type
    1           CCCC
    4           yyyyyIf the user clicks the create insert button it should insert 5(4+1) as the value in new row
    can anyone help me..,

    Thank you jhon for your reply..,
    I will suerly follow ur words if i m havin more than 1 user but in my project i m having only one user so that i think this would be the best one.,
    could u pls tell me the solution for this..,
    I had used this code in my EOImpl method
        protected void doDML(int operation, TransactionEvent e) {
            if(operation == DML_INSERT){
                RowSet seqForThisEmp = (RowSet) getgljrnlctVO1();
                gljrnlctVORowImpl nextSeqNoRow =(gljrnlctVORowImpl) seqForThisEmp.next();
                Number next_seq = nextSeqNoRow.getSeqNo();
                this.setGjhJrnlNo(next_seq); // In this line we have the value 45120
            super.doDML(operation, e);
        }But after create insert and commit operation in the UI i m having the values as -5565656565650000000000000
    pls tell me if there any other solution for this
    Edited by: wilhelm wundt on Oct 11, 2011 2:43 AM

Maybe you are looking for