Document Templates and Datasources
Submitted by Ben_Charlton on Wed, 28/01/2015 - 13:25
I have been putting off report redesign
I have started testing to see if we can move vacc certs into Jasperreports, to allow utilization of report design features not available to office.
My question is really on datasource.
I want to utilize
$P{dataSource}.getExpressionDataSource("reminder:getReminders(., 3, 'YEARS',true())"
which in theory is possible as it the dataSource for vacc cert should be Patient Form or
act.patientDocumentForm
unfortunately it doesnt work...but no error is thrown in the normal interface.
additionally I tried to add :-
[openvpms:get(reminder:getDocumentFormReminder(.), "endTime")]
which failed with the message - indicating that probably the reminder functions arent available... but i did add the
the ReminderFunctions as an import class.
<message>Failed to generate report: Error evaluating expression : Source text : $F{[openvpms:get(reminder:getDocumentFormReminder(.), "endTime")]}</message> <exception> <type>org.openvpms.report.ReportException</type> <message>Failed to generate report: Error evaluating expression : Source text : $F{[openvpms:get(reminder:getDocumentFormReminder(.), "endTime")]}</message> <stackTrace>
Any ideas?
Ben
Re: Document Templates and Datasources
You don't need to import anything to run xpath expressions.
For the first case, it looks like you are missing a trailing ). Try:
$P{dataSource}.getExpressionDataSource("reminder:getReminders(., 3, 'YEARS',true())")
For the second case, there should be a more helpful stack trace in openvpms-full.log.
Re: Document Templates and Datasources
Thanks I solved returning the
[openvpms:get(reminder:getDocumentFormReminder(.), "endTime")]
error it was just a date-string conversion error
The other one isnt working tho.
$P{dataSource}.getExpressionDataSource("reminder:getReminders(., 3, 'YEARS',true())")
I just didnt copy the last bracket when I posted...the expression is exactly the same as the one you listed, but it simply doesnt work and doesnt throw any errors to the log.
when I have time I will fire up the debug interface and see If i can step through it