Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Runtime parameter issue(Runtime parameter issue)
Runtime parameter issue [message #885929] Wed, 13 June 2012 22:08 Go to next message
A R is currently offline A RFriend
Messages: 104
Registered: April 2012
Senior Member
Hi - I have the following query in my dataset.

=====================================================================================
select ASSETID,ASSETURN,ASSETNAME,"ASSET-SOURCE-NAME" from erruser.RPT_CLASSIFIERS_36
WHERE "ASSET-SOURCE-NAME"='COMMON_LIB'
=====================================================================================
And I am using the below scirpt in beforeopen for the same dataset, to pass runtime Library_Id value.
=====================================================================================
//Here I am passing the table name in runtime
var id = new String(params["libraryID"]);
var name = new String(params["ASSET_SOURCE_NAME"]);
var num = id.substr(id.indexOf(':',0)+1,id.length);
query = new String(this.queryText);
query = query.replace(/(RPT_[a-zA-Z_]+)(\d+)/g,"$1"+num);
this.queryText = query;
=====================================================================================

The above script is working fine as it is. But is I try to pass the 'ASSET-SOURCE-NAME' in run time I am facing issue. I tried with the following script ...

=====================================================================================================
//Here I am passing the table name in runtime
var id = new String(params["libraryID"]);
var name = new String(params["ASSET_SOURCE_NAME"]);
var num = id.substr(id.indexOf(':',0)+1,id.length);
query = new String(this.queryText);
query = query.replace((/(RPT_[a-zA-Z_]+)(\d+)/g,"$1"+num),(/'COMMON_LIB'/,'name');
this.queryText = query;
=====================================================================================================

Please help me with your suggestions and inputs.

Thanks,
AR

[Updated on: Wed, 13 June 2012 23:53]

Report message to a moderator

Re: Runtime parameter issue [message #885961 is a reply to message #885929] Wed, 13 June 2012 23:54 Go to previous messageGo to next message
A R is currently offline A RFriend
Messages: 104
Registered: April 2012
Senior Member
Attached the report design that I am working.

Thanks
AR
Re: Runtime parameter issue [message #886144 is a reply to message #885961] Thu, 14 June 2012 10:26 Go to previous messageGo to next message
Dnns . is currently offline Dnns .Friend
Messages: 30
Registered: May 2012
Member
Hey,

my first Question: What would you like to do with this scripts? Do you need them really, or is there another possibility to achieve the result you wanna have?

Which issues do you get?
Re: Runtime parameter issue [message #886331 is a reply to message #885929] Thu, 14 June 2012 18:40 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Can you use

var newwhere = "LIBRARY_ID='"+params["libraryID".value]+"'";
this.queryText = this.queryText.replace("LIBRARY_ID='422:36'", newwhere );

Jason

On 6/13/2012 6:08 PM, A R wrote:
> Hi Jason and All - I have the following query in my dataset.
> ============================================================
> SELECT UPPER ("ASSET_SOURCE_NAME") as "ASSET_SOURCE_NAME" FROM
> ERRUSER.RPT_ASSET_SOURCE where LIBRARY_ID='422:36'
> ===========================================================
> And I am using the below scirpt in beforeopen for the same dataset, to
> pass runtime Library_Id value.
> ==============================================================
> var id = new String(params["libraryID"]);
> query = new String(this.queryText);
> query = query.replace(/LIBRARY_ID=+)(\d+)/g,"$1"+id);
> this.queryText = query;
> ==============================================================
>
> I am not able to achieve the required result. Please correct me if I am
> wrong. Attached the report design.
>
> Thanks,
> AR
Re: Runtime parameter issue [message #886337 is a reply to message #886144] Thu, 14 June 2012 18:51 Go to previous messageGo to next message
A R is currently offline A RFriend
Messages: 104
Registered: April 2012
Senior Member
Its not necessary with scripts, may be we can achieve through other way. But I need to develope a report design which can work with multiple versions of same tables. For which I need to pass the table name (libraryId in my case) at run time. Which I can achieve through script only, to my knowledge. And the secpond parameter which I am trying to include is depend on the LibraryId.

Does it answer your question. Please let me know if I am missing any info required.

Thanks
AR
Re: Runtime parameter issue [message #886339 is a reply to message #886331] Thu, 14 June 2012 18:53 Go to previous messageGo to next message
A R is currently offline A RFriend
Messages: 104
Registered: April 2012
Senior Member
Thanks Jason,

I will try and update you on the same .

-AR
Re: Runtime parameter issue [message #886905 is a reply to message #886331] Fri, 15 June 2012 20:16 Go to previous message
A R is currently offline A RFriend
Messages: 104
Registered: April 2012
Senior Member
Thanks a ton Jason.

It worked.

Have a great weekend Smile

Regards
AR
Previous Topic:Call Javascript From Report Drill Down
Next Topic:Some text in charts are not anti-aliased
Goto Forum:
  


Current Time: Tue Apr 23 07:51:10 GMT 2024

Powered by FUDForum. Page generated in 0.03830 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top