Home
Analytics
Need help passing parameters to report from maximo.
kilo316
Hello,
I need to know how to create a birt report such that when the user clicks on the direct print icon in maximo, that the list of work orders belonging to the current data set is passed to the birt report and then each work order page is created for printing...
How is it different than writing a report where you specify the input parameter that get passed to the sql?
Thanks!
Find more posts tagged with
Comments
wwilliams
" where " + params["where"] in the open method. Look at wotrack.rptdesign to start with.
The where Maximo passes should be the current data set using the where clause found by doing an Advanced Search, Where Clause.
If you don't include the "where" parameter, then the parameters you specify can be used as long as you add them to the SQL script.
Please read the Report Guide as it will explain much of this.
http://www-01.ibm.com/support/docview.wss?uid=swg21498572
kilo316
Thanks. I have been looking at the IBM Maxmio birt example reports. But it seems that they require a lot of manual editing of javascript. Is there not a GUI/IDE way of creating a report such that it takes in the "where" parameter and adds it to the sql? Otherwise it seems I need to manually data enter all the columns in the data set (?)
wwilliams
Hi,
Yes Maximo uses a scripted data source, so for the most part you will be typing all the SQL code and more.
You can always do some cutting and pasting, but it will still require editing.
kilo316
THank you!
Ok was able to create a mainDataSet that takes in the WHERE parameter from the current maximo context (ie workorder.wonum='1111'..... BUT now I need to take some values that are returned from the mainDataSet, and use them to restrict the sql in additional "childDataSets" appearing in the same report. How do I reference values returned in the main data set from within the childDataSet?? In the sample reports I see things like "rows[0]["orgid"]" , how does this work?
Ed
micajblock
take a look at this example:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/530-sample-birt-sub-report-example/
kilo316
Thank you for the example.
BUT, in the example, the detail data set has an input parameter, how does this get passed into the detail data set sql from the master record (for each of the master records)???
Ed
micajblock
look at the binding of the table. There is a button for Dataset binding.
kilo316
In other words, how does birt know that "param1" of the detail data set needs to be passed the ordernumber from the master data set??? where is that mapped?
kilo316
for the life of me, I cannot find the "button" for dataset binding... can you give me some more info?
micajblock
see attached image
kilo316
ok, I found the dataset parameter binding button.... BUT is this just to bind the child parameter to the child dataset column value? HOW/WHERE does MASTER column value get mapped to the DETAIL input parameter?
Thank you for your help!
micajblock
right here
kilo316
I see, and that is very helpful, but as I look at this more, I am going to need to use a scripted dataset, and then somehow link these scripted datasets together in a master detail relationship, but HOW? :
childDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
childDataSet.open();
var sqlText = new String();
sqlText = "select workorder.description"+
" from MAXIMO.workorder "+
" where workorder.parent = ((((WHAT DO I PUT HERE???????) "
" order by workorder.wonum "
;
childDataSet.setQuery(sqlText);
micajblock
OK, IBM like to make things difficult with their scripted data source. Take a look at the OOTB woprint.rptdesign. It has a bunch of nested tables. It has code like this:
+ "and ((workorder.parent = '" + rows[0]["wonum"] + "' and workorder.taskid is not null) "
kilo316
ok, but where does "rows[0]" come from? How does this get mapped to the master data set? When I try (rows[0]["wonum"]), it is coming back without a value?
micajblock
did you nest tables?
kilo316
That was it...forgot to nest tables.... it all works! thank you sooooo much!!!! **** Bless you!