0

I would like to add a dynamic parameter in addition to parameters from Maximo inside SQL query.

Something like that :

select * 
from workorder a 
where params["where"] or a.parent = :Param

with params["where"] with wonum='1234' and :Param = '1234'

Is it possible with Birt to get wonum value and put it also to :Param ?

Or maybe another way ?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

3 Answers3

0

open is like that (query is more complicated so I simplify it):

maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
maximoDataSet.open();

var sqlText = new String();
sqlText = "select column1, column2 as woParent, etc... from workorder where  " + params["where"] + " or woParent=:param";

maximoDataSet.setQuery(sqlText);

beforeopen is like that(just to see the query) :

importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/birteaump.log", true ) );
out.println( "\nMy Query: " + this.queryText);
out.close();

I had some code to manipulate :param to replace it with wonum but this.queryText is null. I'm a newbie to birt report maybe I have to think differently to solve my problem.

Thanks

0

I used Birt 3.7.1. I saw in a video that we can add a query in a dataset's dialog box. But with my report I only have "scripted data set" when I use the "new data set" button.

Is it possible that my query is null in "beforeopen" is in relation with that ?

If I create another sort of datasource, I will have acces to another sort of dataset ?

thanks

0

ok I solved my problem. I created a JDBC data source and I have access to a new sort of data set. I can put my query in this data set and I have access to "beforeopen" and my query is not null.

Thanks