Jump to content
We've recently updated our Privacy Statement, available here ×
  • DATERANGE() function uses wrong start/end day for the WEEK range


    Friendly User
    • Features: Reports Product: JasperReports® Server

    Scenario:

    In your report or ad hoc template you're using DATERANGE() function to construct a date range from a string (i.e. DAY, WEEK, MONTH, etc.) When report with such function is deployed on the JasperServer, for the WEEK value the start and end of the week is incorrect: server is configured for start to be Monday and end to be Sunday but the start is Saturday and end is Sunday. How to avoid this problem?

    Solution:

    the DATERANGE() function builds the Date Range object with report locale instead of the bundle that is specified in the JRS. It's a built-in JasperReports function that is separate from JasperServer.

    You could try constructing a date range in the following fashion:
    new net.sf.jasperreports.types.date.DateRangeBuilder((String) $F{value}).set($P{REPORT_TIME_ZONE}).toDateRange()


    User Feedback

    Recommended Comments

    There are no comments to display.



    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...