You'll have to do some manipulation since they are not automatically added to the where clause (as you noted). I'm not sure how you want it to look, but you can drag the parameters onto the report to display their entered values - or create a dynamic text/data element and make the value params["StartDate"]
etc. and you can add any extra text around that that you want.
If you want it to look like a SQL query, assumedly you are already adding the unbound parameters to your where clause it in the open script, so you can use the work you've already done. You can copy the "where" part of your query in the open script and either assign it to a variable in the open script and then make the value of a dynamic text element the name of your variable, and or just copy what you have in the open script into a dynamic text element.
For instance, something like this in the open script:
sqlText = "select workorder.wonum, workorder.reportdate, workorder.actfinish, "
+ " from workorder "
+ " where " + params["where"]
+ " and workorder.actfinish >= " + MXReportSqlFormat.getStartDayTimestampFunction(params["StartDate"]);
+ " and workorder.actfinish < " + MXReportSqlFormat.getEndDayTimestampFunction(params["EndDate"]);
var whereClause = params["where"] + " and workorder.actfinish >= " + MXReportSqlFormat.getStartDayTimestampFunction(params["StartDate"]);
+ " and workorder.actfinish < " + MXReportSqlFormat.getEndDayTimestampFunction(params["EndDate"]);
Then display whereClause
in a dynamic text element.
I also often just create a new dynamic text element and display sqlText in that element, but that gives you the select statement and everything.
------------------------------
Danielle
------------------------------
Original Message:
Sent: 02-25-2025 03:18
From: JustIn goodLuck
Subject: Birt Report : Display Query/Filter Criteria in downloaded Birt reports in maximo
Thanks Danielle for your response.
Yeah , it will display only parameters which are tagged with params["where"] in reports and bound parameters as well.
But not able to display all unbound parameters which are not tagged with params["where"]. Do we have any option to display them as well?
Ex:-
In request Page, we have 3 parameters.
StartDate/EndDate are not tagged with param["where"] in report and also those are unbound.
Siteid is a bound parameter and also not tagged with a report.
While we display params["where"], only the siteid field is visible in the report as it is a bound parameter.
So I need to understand how to display other unbound parameters in where clause even those are not tagged in the report.
Thanks
Original Message:
Sent: 2/24/2025 3:48:00 AM
From: Danielle Shaw
Subject: RE: Birt Report : Display Query/Filter Criteria in downloaded Birt reports in maximo
Hi --
For the particular part of the query you want to insert a dynamic text element in your report and make the value of it
params["where"]
------------------------------
Danielle
Original Message:
Sent: 02-23-2025 09:37
From: JustIn goodLuck
Subject: Birt Report : Display Query/Filter Criteria in downloaded Birt reports in maximo
Hi Prashant,
This process will display complete SQL Query in report.
Do we have any option to display only filter criteria which we use to populate while running reports ?
LIke :
If we have two filter option on specific reports :- SiteId and Status
only these 2 filter criteria should be populated in a form like SITEID="" and Status="" .
Note :- While creating adhoc reports , we use to get this type display in botton of report.
Thanks
------------------------------
JustIn goodLuck
ABS
Original Message:
Sent: 02-23-2025 02:42
From: Prashant Sharma
Subject: Birt Report : Display Query/Filter Criteria in downloaded Birt reports in maximo
Hi Justin,
This should be done in BIRT Design File. This approach will display the SQL query and the parameters used when generating the report, making it visible in the downloaded report-
- In the BIRT report design, create a new script variable to store the query information.
- Modify the report's data set script to capture the SQL query and parameter values.
var sqlText = this.queryText; // Captures the actual SQL query
var queryInfo = "SQL Query: " + sqlText + "\n\nParameters:\n";
for (var param in params) {
queryInfo += param + ": " + params[param].getValue() + "\n";
}
// Store the query info globally for later use
reportContext.setPersistentGlobalVariable("queryInfo", queryInfo);
3. Add a new text element to your report layout where you want to display the query information.Assign the queryInfo
variable to the text element.
4. In the report's beforeFactory script, add: reportContext.setPersistentGlobalVariable("queryInfo", reportContext.getPersistentGlobalVariable("queryInfo"));
5. In the text element's value expression, use: reportContext.getPersistentGlobalVariable("queryInfo").
6. Import the reportdesign file to Maximo.
------------------------------
Regards,
Prashant Sharma
IBM Champion 2022|2023|2024|2025
Connect with me @ https://www.linkedin.com/in/psharmamaximo/
Lets learn MAS @ https://www.youtube.com/@reliabilityodyssey/
Original Message:
Sent: 02-21-2025 01:58
From: JustIn goodLuck
Subject: Birt Report : Display Query/Filter Criteria in downloaded Birt reports in maximo
Hello,
I was checking if we can add query in reports to see in downloaded reports.
Do we have any option/Configuration available in maximo to include query/filter criteria in Birt reports while download in maximo ?
Thanks
#MaximoApplicationSuite
#Reporting
------------------------------
JustIn goodLuck
ABS
------------------------------