Runtime parameter issue [message #885929] |
Wed, 13 June 2012 22:08 |
A R 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 #886331 is a reply to message #885929] |
Thu, 14 June 2012 18:40 |
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04895 seconds