Jump to content
Changes to the Jaspersoft community edition download ×

a problem by using a user defined function in jrxm


mary_k

Recommended Posts

Hi,

i would like to use a user defined function in jrxml but it is not working.

it is the part in the jrxml:

<textFieldExpression class="java.sql.Timestamp"><![CDATA[getPersianDate($F{DAT_CREATION})]]></textFieldExpression>

Then in the application that filling is done i have added a method called getPersianDate(Timestamp dat_creation)

But i get the following error:

Caused by: groovy.lang.MissingMethodException: No signature of method: TableReport_1280387733008_408819.getPersianDate() is applicable for argument types: (java.sql.Timestamp) values: {2010-01-05 12:20:18.857}

could somebody please help me? how can i get rid of this error?

Thanks in advance.

Best Regards,

Mary

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

thanks for you solution but it did not work. I get the following error:

Caused by: groovy.lang.MissingPropertyException: No such property: TableApp for class: TableReport_1280648128136_469927

and

Error evaluating expression :
    Source text : TableApp.getPersianDate($F{DAT_CREATION})

I think some how the class TableApp must be defined in jrxml. But do not know how.

Could you please help me.

Thanks in advance.

Best Regards,

Mary

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

thanks for your reply. But it was not the reason. I found the solution, namely the class in which the method is defined, must be imported in the jrxml file:

<import value="packagename.classname"/>

packagename is the package where the class is placed.

It is important to put the import tag after the property tag and before the parameter tag.

I hope this will help others.

Thanks.

Bye,

Mary

 

 

Link to comment
Share on other sites

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