extract(year, current_date) extract(year, _add_years(current_date,-1)) extract(year, _add_years(current_date,-2))
Step 2. create prompt control of list box, sorting items in descending order
<contents> <selectValue parameter="PromptYear" refQuery="ThreeYearQuery" selectValueUI="listBox" multiSelect="true" required="false"> <useItem refDataItem="Year"> <displayItem refDataItem="Year"/> </useItem> <sortList> <sortItem refDataItem="Year" sortOrder="descending"/> </sortList> </selectValue> </contents>
step 3. display the selected year in report
<contents> <block> <contents> <textItem> <dataSource> <staticValue>ParamCount('PromptYear')=</staticValue> </dataSource> </textItem> <textItem> <dataSource> <reportExpression>ParamCount('PromptYear')</reportExpression> </dataSource> </textItem> </contents> </block> <block> <contents> <textItem> <dataSource> <staticValue>ParamDisplayValue('PromptYear')=</staticValue> </dataSource> </textItem> <textItem> <dataSource> <reportExpression>ParamDisplayValue('PromptYear')</reportExpression> </dataSource> </textItem> </contents> </block> </contents>