Jump to content

Recommended Posts

Posted

Hi all

I have a crosstab report which displays months as rows. When i run the report the rows start with aug and go on in ascending order. How can i sort this report based on our calender like jan, feb,march .....
Thanks

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

you should add month number like '01-Jan'. So jasper will order as you want. Or, there is a field like MONTH_NUMBER in your query result, you can use month_number as sort field.

Posted

thank you for your reply.

what i do is edit the query to be (TO_CHAR(REQUEST_TIMESTAMP, 'MM') "REQUESTDATE") to return the date just like 01,02,03,.... then i put in the expression for requestdate header

(
    $V{REQUESTDATE}.intern() == "01" ? "Jan" :
    $V{REQUESTDATE}.intern() == "02" ? "Feb" :
    $V{REQUESTDATE}.intern() == "03" ? "Mar" :
    $V{REQUESTDATE}.intern() == "04" ? "Apr" :
    $V{REQUESTDATE}.intern() == "05" ? "May" :
    $V{REQUESTDATE}.intern() == "06" ? "Jun" :
    $V{REQUESTDATE}.intern() == "07" ? "Jul" :
    $V{REQUESTDATE}.intern() == "08" ? "Aug" :
    $V{REQUESTDATE}.intern() == "09" ? "Sep" :
    $V{REQUESTDATE}.intern() == "10" ? "Oct" :
    $V{REQUESTDATE}.intern() == "11" ? "Nov" : "Dec" )

and now the report is sorted.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...