When adding parameters to a report, we actually can ask
the jasper report for the names and types of its
This patch takes advantage of this to modify the
EditReportParameterMap.vm so that instead of providing
a dropdown of parameters to add, it is a list of
If a missing parameter has the same name as an existing
parameter, then there is a button to add it directly.
If a missing parameter has no matching existing
parameter, then there is a button to create the
parameter (prepopulating the form with the known data
about the parameter).
OpenReports and JasperReports provided parameters are
excluded from the missing parameters list.
There are two things I don't like about this patch:
1. I wasn't sure where the best place was to put the
method to get the list of parameters from the actual
jasper report. For now, it is in ReportProvider.
2. When you create a parameter via the
EditReportParameterMap.vm, once you are done creating
the parameter, it should really take you back to the
editReportParameterMap.action for the original report
you were setting up.
This also, of course, precludes adding parameters to
the report that the report does not explicitly
reference. If this is overly restrictive, the original
add dropdown can be reintroduced as well.
Despite these weaknesses, I think it is still a big
help for the users not to have to look up the parameter
names/types outside of OpenReports.
Hope you find this useful.