Jump to content
Changes to the Jaspersoft community edition download ×

Jasper week number from given date - WEEKUM()


bmw328i

Recommended Posts

Hi all,

I`m using Jasper Reports for creating printouts in my Spring Boot application. I`m dispalying my persist entity in the report. One of the field is 

@DateTimeFormat(iso = ISO.DATE)private LocalDate documentDate;[/code]

I`m displaying this date just simple

<field name="myEntity.documentDate" class="java.lang.String"/>[/code]
<textFieldExpression><![CDATA[$F{myEntity.documentDate}]]></textFieldExpression>[/code]

this works FINE.

Now I`d like to show week number from this date. So, in Jasper XML I created variable like this

<variable name="week_no" class="java.lang.Integer">  <variableExpression><![CDATA[WEEKNUM($F{myEntity.documentDate})]]></variableExpression></variable>[/code]
<textFieldExpression><![CDATA[$V{week_no}]]></textFieldExpression>[/code]

I`m getting net.sf.jasperreports.engine.JRRuntimeException: Function WEEKNUM not found

How to get week number in my case?

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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