Home
Analytics
Where param and a text parameter
rmendonsa
I have a report that needs to run from the Asset Application. If a particular asset number is selected, it needs to run that report for just that asset number. If no asset number is selected and the report is run from the list the report needs to run for all assets.
Here is my dilemma though...
In addition to the application parameter, I need to include an input text parameter as well for a Condition column. This parameter is not based on any database field. If a user types in 'A' then 'A' needs to show up on the report under the condition column.
I have in my report, used the where " + params["where"] for the application parameters and it works fine even when the report is run from a particular asset number in maximo, however, when I create the text parameter for the Condition, it causes the report to run for all assets although, the report is being run for only one Asset number which is assetnum = '1010'.
Not sure what it is that is causing the report to fail. Any suggestion is highly appreciated.
Thanks.
Find more posts tagged with
Comments
mwilliams
Can you attach your report design? I'll take a look at your setup. If you can't can you set up what you're doing in a sample report that uses the sample database? Thanks!
rmendonsa
Unfortunately, due to confidentiality reasons, I am unable to send you the design file. However, I have included my query below as well as an attachment of the text parameter. Hopefully, you can help me out with the information I have provided.
maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
maximoDataSet.open();
var sqlText = new String();
// Add query to sqlText variable.
sqlText = "SELECT asset.assetnum"
+ " , asset.description, asset.purchaseprice"
+ " , asset.rowstamp,"
+ " DATEDIFF (day, CONVERT(datetime, '1900-01-01', 110), GETDATE())as JulianDate"
+ " FROM asset"
// Include the Maximo where clause
+ " where " + params["where"]
+ " ORDER BY asset.assetnum"
;
Thanks.
mwilliams
I don't know if I'm able to see what is causing your issue by adding the "text parameter" with this information. What is your params["where"] equal to? Where are you setting this? Also, what are you doing with the "text parameter" in your report? It might be best if you can recreate this issue with the sample database if you can't send me the report. If posting the report in here is the only issue, you can email it to me directly. You could also make a copy of the report and remove any company specific information that would make this non-confidential if that's an option.
rmendonsa
I will try and recreate the report. The params["where"] is equal to the current application for example Asset. If I am in the Asset Application and I run the report for Asset 1010 in Maximo, then the report needs to get generated for that particular asset. If I am running the report from the List view of the Asset application it needs to run the report for all assets.
The text parameter is just a static text value that needs to go on the report.
Thanks.
mwilliams
If you're having an issue with only one asset going through when you're expecting more, there's a problem with the where clause. Putting the parameter value in the report shouldn't have an affect on anything at all. If you're just bringing in a straight text parameter to display in the report, you should be able to just call params["condition"] from a dynamic textbox where you want it. With the where clause, if you click on a link from your application to run a single asset, using the where clause is fine. If you run the report expecting all assets to run, you'll need to edit your queryText to disclude the where clause. This is where I'm assuming the issue is at this time. If you can show me the script or however you're setting the "where" parameter, that'd be helpful.