Maximo Open Forum

 View Only

 BIRT Report Current User who ran the report

Jump to Best Answer
  • Reporting
Eric Burkland's profile image
Eric Burkland posted 06-08-2023 16:33

I have a request to write a BIRT report which shows LABTRANS records for the user who is running the report and for a date range which they put in as parameters. 

How do I get the user who currently is running the report and use it in the sqlText?  

Thanks!

Jan Ondrušek's profile image
Jan Ondrušek Best Answer

Hi Eric,

you need to add new paremeter into report and use this parametr in SQL query. Check this link: https://www.ibm.com/support/pages/how-add-username-v7-birt-report

Example how to use this parameter in SQL:

+ " LEFT JOIN PERSON ON person.PERSONID = upper('" + params["userName"].value + "') "

 

Eric Burkland's profile image
Eric Burkland

Thank you @Jan Ondrušek   I tried this initially and it didn't work.  The key piece that I wasn't doing correctly is after importing the report from the Report Administration page you have to delete the userName parameter from the Parameters listed on the page.  If you leave it there it expects a value when the user runs the report and if you run the report anyways without a value it leaves it as null.  I guess reading the document carefully is important :-)  

Thanks Again,

Eric

Rekha I's profile image
Rekha I

Hi Eric, Did this work for you? I have a similar request to get the username who is running the report and I followed the instructions from IBM but did not work.