Unfortunately, when testing (or debugging) a report using the Desktop designer, there is no obvious way to set the username – this means all the queries have to be manually changed to use a string literal (e.g. ‘acave’) with all the risks that might entail.
However, a tip I discovered on an obscure forum from more than a decade ago , allows the setting of the username value at program startup.
In the file
[PRD_INSTALL_PATH]/report-designer/resources/classic-engine.properties
(on my Win10 setup, it’s in C:\pentaho\design-tools\report-designer\resources\classic-engine.properties)
Find the line
org.pentaho.reporting.engine.classic.core.environment.username=Designer
and change it to (your user for testing). Here I’m using ‘test_user_name’
org.pentaho.reporting.engine.classic.core.environment.username=test_user_name
Save the file and restart the Pentaho Report Designer. When running your queries, the ‘${env::username}’ will be replaced with ‘test_user_name’ when the queries are run.
Andrew Cave
Andrew Cave is a senior data engineer with BizCubed. He has worked in network data, billing, telco credit and debt after a career in the welfare sector. He loves databases. Follow him on LinkedIn