Search code examples
oracle-databasejasper-reportsjasperserverwindow-functions

Is it possible to use SQL window functions with Jasper ReportServer?


Question about Jasper ReportServer 5.1 and its DomEL (Domain Expression Language).

I have a Domain with just one table. T is a table, (day date, value number) are columns with their types in Oracle.

So, if I try to make new "Calculated Field" in my Domain with expression:

first_value(value) over (order by day)

error message appers:

Found 'over' after end of expression

The main reason I think:

http://community.jaspersoft.com/documentation/sql-functions

Quote:

You may use SQL functions in a DomEL expression, but only in limited circumstances:

• The functions must be supported by the database. See the vendor documentation for available functions and their syntax. • The functions must follow the convention of comma-separated parameters. For example, you can use TRIM(person.name), but not TRIM('Jr' FROM person.name) • The type of the return values must be appropriate, either within the expression or for the type of the calculated field. • The SQL context must be appropriate for the functions. For example, you cannot use aggregation functions such as COUNT in a calculated field because there is no GROUP BY clause. Except for the comma-separated parameter pattern, the DomEL validation cannot enforce these criteria. You must ensure that any SQL functions meet these criteria, otherwise the expression causes errors when using the Domain to create a report.

Is my problem the result of this "enforcement"?

How can I use SQL window functions to construct calculated field?

Is there any way in Jasper to achive first_value/last_value/lead/lag effect?

Thank you!


Solution

  • It is absolutely impossible. Very sad.