How to display Current Year and Month in Drop Down list

Hi Dear friends,
I am devloping a report. It has got 2 pages--input and output(Report) page.
IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
Now, my problem is:
HOw to display current month and year by default in the dropdown list...........
I hope my question is clear.
Please help.
Regards,
ASh

NO da,
it is not working.
First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
So, i posted the question.
I tried your code. It is giving following error.
A Servlet Exception Has Occurred
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
first.set(Calendar.YEAR, 2003)
^
An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
^
4 errors
Pls. Help.
Regards,
Ashu

Similar Messages

  • How to populate both key and text in drop down list in dialog prog screen

    Hi, Can anyone please advice how to display both key and text in the drop down list in dialog prog screen. I tried with below code. keys and texts are getting populated in values table but only text is appearing when click on drop down. need to display both key and text in the drop down. Thanks in advance.
    TABLES: ZRPP_MODELS, ZRPP_FFLSTRATEGY.
    TYPE-POOLS : VRM.
    DATA : field_id TYPE VRM_ID ,
           values   TYPE VRM_VALUES,
           value    LIKE LINE OF values.
    FORM fill_model_list .
      select MODEL MODEL_DESC from ZRPP_MODELS into value.
        APPEND value TO VALUES.
      endselect.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id     = 'ZRPP_MODELS-MODEL'
          values = values.
    ENDFORM.

    You need to concatenate KEY & VALUES
      wa_values-key = '1'.
      wa_values-text = '1 - One'.
      append wa_values to i_values.
      wa_values-key = '2'.
      wa_values-text = '2 - Two'.
      append wa_values to i_values.
      wa_values-key = '3'.
      wa_values-text = '3 - Three'.
      append wa_values to i_values.
      call function 'VRM_SET_VALUES'
        exporting
          id              = 'LIST_BOX'
          values          = i_values
        exceptions
          id_illegal_name = 1
          others          = 2.

  • I have Maveriks. I downloaded numerous ACID Fonts and purchased Stuffit as instructed by ACID Fonts in order to use them. However, now I am unable to figure out how to get them into my Font Family drop down list or insert into Pages. PLS HELP!

    I have Maveriks. I downloaded numerous ACID Fonts and purchased Stuffit as instructed by ACID Fonts in order to use them. However, now I am unable to figure out how to get them into my Font Family drop down list or insert into Pages. PLS HELP!

    Hi FancyJean!
    Here is an article for you about using Font Book and installing fonts that you have downloaded:
    Mac Basics: Font Book
    http://support.apple.com/kb/ht2509
    Thanks for being a part of the Apple Support Communities!
    Cheers,
    Braden

  • Can I copy and paste a drop down list into another field?

    Can I copy and paste a drop down list into another field?

    You don't have to create a PDF, but it would be helpful to know what, exactly, you want to do with the ppt.
    You can export as a PDF which will keep vectors and text as PostScript (crisp) elements.
    You can also Save As from ppt in a variety of formats such as PNG or TIFF.
    These rasterize all the vectors and text, but are very useful if you're laying out a miniature gallery of the powerpoint presentation.
    However, if you want to make the InDesign file a replica of the ppt slides for print, PDF is probably the best way to go.

  • Displaying current year and previous year's data.

    hi all,
    we have fields like doc.no, company code, costcenter, posting date, year etc... in a query.
    we are using this query to display data in VC,
    how can i display the current year and previous year's data in two different tables using the available fields.
    any help will be highly appreciated.
    thanks,
    Rk

    Hi Rk,
    You can achieve your requirement using 'Filter' operator. Drag one 'Filter' operator into visual composer story board and drag the output into filter and add condition(Check year=2008) and drag one table from filter. For another table use another filter and change the condition.
    Hope it helps...
    Regards
    Basheer

  • BEx - Display current year and previous year by day on the same row

    Hello experts, need some help/suggestions on how I can accomplish the following please. 
    We have a requirement to show MTD revenue by day for the current year and previous year.  The desired result will have the following columns
    Calendar Day   |     Current MTD Revenue     |     Prev MTD Revenue
    11/01/2009       |      15,131,005                    |        15,138,668
    11/02/2009         |    15,055,345    |                        15,523,762
    However, the result is showing up as follows:
    Calendar Day   |     Current MTD Revenue     |     Prev MTD Revenue
    11/01/2008       | |                                                   15,138,668
    11/02/2008       | |                                                   15,523,762
    11/01/2009       |      15,131,005 |
    11/02/2009       |      15,055,345 |
    The number of rows for Calendar Day varies depending on the date the user selects.  We only want to display the days for the current year with the Previous Year Column on the same row. 
    Can someone please let me know how I can get the results to display on one line for each day? 
    Thanks,
    David

    I have the same issue on my end, and am interested in responses. I searched the forum and found this suggestion in another post; not sure if this solution will help, but it looks like it might. This was a response from poster RadhaN:
    RadhaN  
    Posts: 390
    Registered: 8/27/09
    Forum Points: 876 
       Re: a simple query to show sales versus last year on daily basis/   
    Posted: Sep 21, 2009 9:53 AM    in response to: Shlomi Weiss           Reply 
    HI Shlomi
    Create a virtual characteristic in your infoprovider that can calculate the day from calendar Day. In ZXRSRZZZ while adding code for this virtual characteristic use the function module DATE_COMPUTE_DAY to compute the day for every calendar day.
    For calculating Sales Current year, create a restricted ky figure with Sales as the key figure. Add 0CalDay to this RKF and create a variable for this infoobject(Eg: ZCURYEAR) that will receive input from the user for the range of dates eg: 08/16/2009 - 08/22/2009.
    For Sales Prior year, create another restricted key figure with Sales. Add 0CalDay to this RKF and add a customer exit variable. In the Customer exit code use the ZCURYEAR variable and offset it to prior year in both the upper and lower limits. This should work.
    I hope this helps.
    Thanks.

  • How to show current year and last year sales in a WEBI Report

    Hi Guys
    How can show current YEar Sales in one column and Last YEar Sales in the other column based on a user prompt for the Current YEar Column.
    For Example is user enter 2010 for Year how can i show a Column for Sales-2010 and Sales 2009.
    Thanks

    If you can modify your Universe add an object named New Object Last Year whose SQL is:( yourTableName.Year + 1)
    Then in WebI create two distinct queries in your query Pane. In the first one you could do this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:   Year Equal to '1. Prompt Year'
    Query 2:
    objects: Year, Sales ... etc.
    filters:    New Object Last Year Equal to '1.Prompt Year'
    Then in your report you can drag each object on their respective columns.
    If you don't want to use two distinct queries, use one like this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:        Year Equal to '1. Prompt Year'
                 Or
                      New Object Last Year Equal to '1.Prompt Year'
    Edited by: PadawanGirl on Jun 23, 2011 6:28 PM

  • How to set a default value for a drop down list box and then apply cascading based on the default value in Infopath 2010.

    Hello Everyone
    I have two drop downs. Both are coming from look up fields from two lists. i want to set a default value(first list item) for the first drop down list box and then apply cascading based on the default value for the next drop down list box. I found one article(http://www.bizsupportonline.net/infopath2010/display-first-item-drop-down-list-box-infopath-2010.htm)
    where in i can set a default value but i can't apply cascading based on that default value. Any suggestions would be highly appreciated.
    Thanks
    Ramanjulu Naidu N

    Hey Ramanjulu,
    Take a look at the below article which I believe will answer your question.
    http://basquang.wordpress.com/2010/03/29/cascading-drop-down-list-in-sharepoint-2010-using-infopath-2010/
    Daniel Christian (MCTS)

  • Using a iPad.  How do you delete unwanted address from the drop down list.  I typed in a wrong address once, and now it keeps showing up.

    Using a iPad.  How do you delete unwanted address from the mail drop down list.  I typed in a wrong address once, and now it keeps showing up.

    Winfax1-
    Look in your Contacts App and see if the unwanted address is entered there.  If it is, you can delete it there.
    Fred

  • How do I select a item from a drop down list on a web in Safari On An. IPad 2.  The list apears and disapears só QuickClips I cannot TAP anything On The list Quickly enough.

    I tried to select an item from a drop down list on a web page in safari and discovered that the list disapeared to quickly for me to make a selection.  Has anyone else found this and solved the problem.  Many thanks.

    Demo wrote:
    I tried it on my iPad and I see what you mean. From what I can see when I go to the site on my Mac, it is Flash based and that will not work anyway.
    Actually, it is Javascript and uses the 'onmouseover' event.

  • How to add Check box to a static Drop down list (bases on a selection list) and allow mulity select in it?

    Dear All,
    I created a text field in my project (Light switch 201, C#), this text field has a static list which I filled manually. when I click in this text box I get a dropp down list which allow me to chose only one value from it.
    Now what I want to do is to add a check box in this drop down list and allow mulity selection from this list. My list looks as follow:
    Can anyone help me :) ? 
    Thanks all,
    Zayed

    Something like this:
    http://www.codeproject.com/Tips/452756/Add-checkbox-inside-combobox-in-Silverlight

  • How to Generate a report based on a drop-down list?

    Good Afternoon,
    I am looking for a way to create a drop down list/select list with the values '2008' and '2009'. Based on the value selected in the list, data will be displayed from a table.
    In the table, there is January to December for 2008 and January to December of 2009. So when selecting '2008', I would like January to December 2008 to be displayed.
    Thank you.

    Hi,
    Create a static LOV with the following source:
    STATIC:2008,2009
    Assuming your LOV is named P1_LOV your report SQL would look something like:SELECT * FROM TABLE WHERE DATE LIKE '%' || :P1_LOV || '%'

  • How to populate active directory users in to drop down list items dynamically in Share point 2010 ?

    Hi My self Arun in my current project i have a task on that active directory user  need to automatically populate in share point list drop down  please help me.  is that any out of box feature in share point 2010 ?   
    Thanking You 
    Arun 

    Arun,
    If you plan to implement the "Querying the Active Directory" based on my code snippet,
    and if you do not have permission [your account must be the part of domain admin] to do so,
    Then still you can do it in least effort through code,
    string usersInXml = SPContext.Current.Web.AllUsers.Xml;your xml string look like this.
    <Users><User ID="2" Sid="" Name="Administrator"
    LoginName="i:0#.w|murugesan\administrator" Email="" Notes="" IsSiteAdmin="True" IsDomainGroup="False" Flags="0" /><User ID="1" Sid="" Name="Murugesa Pandian" LoginName="i:0#.w|murugesan\murugesan" Email="" Notes="" IsSiteAdmin="True" IsDomainGroup="False" Flags="0" /><User ID="1073741823" Sid="S-1-0-0" Name="System Account" LoginName="SHAREPOINT\system" Email="" Notes="" IsSiteAdmin="False" IsDomainGroup="False" Flags="0" /></Users>
    You can user Linq to XML to filter the "LoginName,Name and Email and then populate your drop down list.
    * User must be logged into the site at least once.
    Murugesa Pandian.,MCTS|App.Devleopment|Configure

  • How to auto populate a field based on drop down list unless specific item is selected

    Hi all,
    Apologies if I have posted this in the wrong area but I am new to Adobe LiveCycle, JavaScript and these forums.
    I am trying to build an Acrobat form using LiveCycle but am having trouble with the drop down lists.
    Inititaly I simply wanted to populate fields in one table based on the selection of a corresponding drop down list in another table.
    I used the following code and it worked fine:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1");
    for (var i=0; i <= fFrom.length-1; i++) {
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
    The problem is that now I want the above code to work UNLESS one of the items in the dropdown list is specifically selected in which case I want the text box in the other table to display a message such as "Enter details in the field below".
    I have tried to create an If Else statement using the following code:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*].Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[*].Row4.Cell1"); 
    for (var i=0; i <= fFrom.length-1; i++) {
         if (fFrom.item(i).rawvalue = "Option 3"){
         fTo.item(i).rawValue = "Enter details in the field below";
         else {
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
    The code now populates the field with "Enter the details in the field below" no matter what item I select from the dropdown list.
    Your help is greatly appreciated.
    Cheers,
    ozzy_q

    Follow Up:
    Ok so ive changed things up a bit and have had some more success.
    I have used a Switch statement in my For loop to perform different actions based on the item selected.
    The code looks like this:
    Workbook.Content.Table1.Row3.AppropriationDetails.Row4.Cell1::change - (JavaScript, client)
    var fFrom = xfa.resolveNodes("Workbook.Content.Table1.Row3.AppropriationDetails[*] .Row4.Cell1");
    var fTo = xfa.resolveNodes("Workbook.Content.Table2.Row3.AppropriationDetails[* ].Row4.Cell1");
    for (var i=0; i <= fFrom.length-1; i++) {
         switch (fFrom.item(i).rawValue)
         case "Option 3":
         fTo.item(i).rawValue = "Enter the details in the field below";
         break;
         default:
         fTo.item(i).rawValue = fFrom.item(i).boundItem(xfa.event.newText);
         break;
    This code solves my problem but has thrown up a new issue:
    When i select Option 1 or 2 from the dropdown list  the change in the text field is instantaneous, however if I select Option 3 it wont appear in the text field until I either select Option 3 a second time or select another item. Its as if the text field is a selction behind what I have enterd in the dropdown list.
    Any thoughts?

  • Why won't previous years disappear off  Library drop down list after delete

    Problem:
    Why does "Early Photos" and the By Year breakdown of my photos still appear after I delete all of them off iPhoto?
    Background:
    I have iPhoto 6.06 with over 13,000 photos. I purchased an external hard drive and backed up the iPhoto Library to its new destination.
    After I made sure that the copy went smoothly, and tested to see if the database was intact and functioning correctly off the external hard drive, I began deleting the images off the iPhoto Library on the internal hard drive.
    I had several albums which I erased easily, but the entire suite of 13,000 photos were assembled by year in the Library drop down as "Early Photos" through 2009.
    I thought that these would automatically disappear, but they didn't.
    Thanks in advance...
    Dan

    They are hardwired into iPhoto v6 and they won’t go away. All you can do is ignore them.
    Regards
    TD

Maybe you are looking for