Home Analytics Designing reports
The community of Analytics developers are invited to follow and participate in the developer network.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.

How to get Year from Date Report Parameter-Birt Report

edited December 31, 1969 in Designing reports
I created one birt report.It contains one report parameter with name "FromDate".User will insert it in a fromat like "dd/MM/yyyy". I want to get year(if date is 11/01/2013.i want to extract 2013 from this varaible) from this input parameter and want to pass this value to one stored procedure(ie data set).How can i do that.Can anyone pls share sample code


  • wwilliamswwilliams Junior Member
    edited December 31, 1969
    use a date parameter and this

    or use text e.g. like you have above.

    Something like this will work
    myYear = params["FromDate"].value.substr(params["FromDate"].value.lastIndexOf("/")+1) ;
  • LesbeaLesbea Junior Member
    edited December 31, 1969
    I had a similar problem in the past, however i looked at from a different angle in driving the date selection from the dates stored in the datasource as a dynamic parameter. Normally then a date from the dataset is in a format which can be formatted/extracted by functions to give the year month day etc.

    "I prefer BIRTual Reality"
  • which parameter lookup name in maximo (like 'datelookup') use for month or year

  • wwilliamswwilliams Junior Member

    There isn't one. You'll have to create it.
    http://www-01.ibm.com/support/docview.wss?uid=swg21605970&aid=1 keep in mind
    Requirements for using lookups with Parameters
    To enable a parameter lookup, the parameter must have an equivalent attribute. This makes the
    parameter bound as noted in the beginning portion of the parameter secti
    Additionally, as noted above, unbound parameter values which have no attributes, cannot have a lookup.
    Domain lookups can only be used when bound to a field that has the domain assigned to it. The only two
    exceptions to this are the datelookup a
    nd yornlookuplist which can be associated to unbound parameter

Sign In or Register to comment.