Use binding expressions in the datasource
Use binding expressions in the datasource
Technologies > User Interface Add-Ins > Parts for Reports > Report with Date and Time Restriction
SQL statements included in the data source may utilize server-side binding expressions. The following data source restriction uses
${sql.date()}
to format the date literal and
${sql.currentDate}
to retrieve the current date:
<restriction type="sql"
sql="date_assigned > ${sql.date('1995-01-13')} AND date_assigned < ${sql.currentDate}" />
<restriction type="sql"
sql="time_requested > ${sql.time('9:00')} AND time_requested < ${sql.currentTime}" />
The
${user}
object includes all properties of the current user account, as well as properties of the employee record associated with the user. Restrict by user name:
<dataSource ... >
<sql dialect="generic">
SELECT project_id, requestor, status FROM project WHERE requestor = '${user.name}'
</sql>
Server-Side Bindings - Data Source Properties