Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
open method for scripted data source
DenisG
<p>Hello, everyone!</p>
<p>I have expirience with creating reports in BIRT for MAXIMO 7.5. And now I want to make few reports for OpenText.</p>
<p> </p>
<p>1. I want to use scripted data source. So I have to replace this strings in open method:</p>
<p> </p>
<div>maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());</div>
<div>maximoDataSet.open();</div>
<div> </div>
<div>.......</div>
<div> </div>
<div>maximoDataSet.setQuery(sqlText);</div>
<div> </div>
<div>Because MXReportDataSetProvider is MAXIMO library and this strings won't work with OpenText.</div>
<div>The question is with what I should replace this strings?</div>
<div> </div>
<div>2. While creating reports for Maximo I could preview reports in BIRT because DB connection data were placed to maximoproperties file. How I can do the same with Opentext? I meant where I should enter DB connection data to preview reports in BIRT before deploying to server. </div>
Find more posts tagged with
Comments
micajblock
<p>If you want to use the scripted data source, you need to follow instructions here - <a data-ipb='nomediaparse' href='
http://developer.actuate.com/deployment-center/integrating-birt-into-applications/birt-with-maximo/'>http://developer.actuate.com/deployment-center/integrating-birt-into-applications/birt-with-maximo/</a></p>
;
<p> </p>
<p>That being said when running on iHub there is no reason to use the scripted data source and you can connect directly to the database using JDBC.</p>
DenisG
<p>Thx for reply!</p>
<p>To be honest by questions above I meant that BIRT is standart report tool for both MAXIMO and for OpenText.</p>
<p>But for MAXIMO there is many useful classes for processing parameters, insert parameters directly to sql query in open method and others. All of this provided throw scripted data source. But during creating reports for OpenText I have to specify query in data set and in beforeOpen method I have to process query with JS functions to insert parameters. For example if I want process parameter as list of values I have to do such processing:</p>
<div>var par = reportContext.getParameterValue("DocType"); </div>
<div>...body += " DOCTYPE.NAME IN ("</div>
<div>for (var keys = 0; keys < par.length; keys++)</div>
<div>{</div>
<div>body += "'" + par[keys] + "'" </div>
<div> </div>
<div>if (keys != par.length - 1) (body += " ,")</div>
<div>}</div>
<div> body += ")";</div>
<div>And then append this stuff to query.</div>
<div>So the question is while for MAXIMO there is many usefull prebuild classes why for OpenText there is not?</div>
micajblock
<p>First of all to think that a scripted data source is easier than JDBC is absurd to me. The JDBC connector has built in support for parameters. List parameter is unique as it is an array and in SQL you cannot do where fieldname in (?).</p>
<p> </p>
<p>In any case. here is an example for list parameters - <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/722-using-a-multivalue-parameter-in-a-in-clause/'>http://developer.actuate.com/community/forum/index.php?/files/file/722-using-a-multivalue-parameter-in-a-in-clause/</a></p>
;
DenisG
<p>Thx, Mica, nice solution for list params! May be I think so because of 3 years of working with scripted data source.</p>
<p>May be there is an easy solution for this task:</p>
<p>Now if I have to insert list params somewhere in SQL query (Not in bottom WHERE clause), in before open method:</p>
<p>1. I have to substring part of query</p>
<p>2. create some clause using params (first_param in ('a','b','c')) and concatenate this to query </p>
<p>3. concatenate last part of query</p>
micajblock
<p>I am not clear what the question is here. The solution I provided just does a replace, so it can be anywhere in the query. </p>
DenisG
<p>Yes, I got it. Thx!</p>