How to get customer and patient ids on invoice?
Submitted by Guest on Thu, 03/01/2013 - 09:56
I need to print the customer and patient id on the invoice. Looking at the existing fields and the posts on the forum, I used customer.entity.id and target.patient.entity.id - but these caused errors.
Using target.patient.entity.id generated the error "net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F{target.patient.entity.id}"
Using customer.entity.id generated the error "Failed to generate report: Error evaluating expression : Source text : $F{customer.entity.id}"
What am I doing wrong?
Regards, Tim
Re: How to get customer and patient ids on invoice?
Given multiple patients can appear on any given invoice patient ID would only be appropriate in the invoice items sub report....that report can be customised to show the patient name.
Only a subset of data is passed to the jasperreports engine as a databean, if the id's arent included u cant access them..TimA may be able to expand. However I have looked at the source code before and neve been able to work it out.
Re: How to get customer and patient ids on invoice?
Ben - thanks for the input. It turns out that it was my screwup (inexperience using iReports). I now have it working correctly. The field names are as above, ie customer.entity.id and target.entity.patient.id.
The trick with iReports is to add the field and rename as required, then change its properties|field class from the default string to whatever the OPV archetype sets (long for the id's), then drag the field onto the report.
Regards, Tim G