Multiple SQL Queries in a Report

The requirement is to create a single report connecting one database:

  • Query1 is a group on demand and contains a histogram and a pie chart on it.
  • Query2 is a simple query that creates a table.

Both of these queries need results based on a proposal WHEREthat is delivered dynamically.

Can someone point me to some examples of how to achieve this?

Thank.

+3
source share
1 answer

You can tell JasperReports to use the parameter to determine part of the request using syntax $P!{PARAMETER_NAME}. This tells JasperReports to use a literal value PARAMETER_NAMEas part of the request. Then you can:

  • WHERE_CLAUSE.
  • WHERE_CLAUSE 1=1.
  • SQL:
    SELECT * FROM table WHERE $P!{WHERE_CLAUSE}

$P! SQL :

SELECT * FROM table WHERE 1=1

. $P{} $P!{} - (!).

SQL.

+3

All Articles