Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Reg dynamic parameter (Reg dynamic parameter )
Reg dynamic parameter [message #896010] Mon, 16 July 2012 17:47 Go to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
For one specific requirement I need to come up a quesry as follows for my dataset.

select * FROM ASSET_REQUEST_29 UNION ALL
select * FROM ASSET_REQUEST_31 UNION ALL
select * FROM ASSET_REQUEST_32 UNION ALL
select * FROM ASSET_REQUEST_33 UNION ALL
select * FROM ASSET_REQUEST_34 UNION ALL
select * FROM ASSET_REQUEST_36

Problem here is there is possibility of that ifin future new version of the "ASSET_REQUEST" is created like "ASSET_REQUEST_37, ASSET_REQUEST_38" then my report won't be able to capture the informaiton from the same. I need to modify the report.

Please suggest me , how can i be able to achieve the approach where I can dynamically over come this issue.

Let me know if I need to provide any details further.

Thanks
AR
Re: Reg dynamic parameter [message #896041 is a reply to message #896010] Mon, 16 July 2012 22:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Do you have a table that stores the highest number?

Jason


On 7/16/2012 5:47 PM, A R wrote:
> For one specific requirement I need to come up a quesry as follows for
> my dataset.
>
> select * FROM ASSET_REQUEST_29 UNION ALL
> select * FROM ASSET_REQUEST_31 UNION ALL
> select * FROM ASSET_REQUEST_32 UNION ALL
> select * FROM ASSET_REQUEST_33 UNION ALL
> select * FROM ASSET_REQUEST_34 UNION ALL
> select * FROM ASSET_REQUEST_36
>
> Problem here is there is possibility of that ifin future new version of
> the "ASSET_REQUEST" is created like "ASSET_REQUEST_37, ASSET_REQUEST_38"
> then my report won't be able to capture the informaiton from the same. I
> need to modify the report.
>
> Please suggest me , how can i be able to achieve the approach where I
> can dynamically over come this issue.
>
> Let me know if I need to provide any details further.
>
> Thanks
> AR
Re: Reg dynamic parameter [message #896236 is a reply to message #896041] Tue, 17 July 2012 12:33 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
No Jason, besides the versions are random sometime depending on architecture. I mean sometimes we may disbale few versions depending on situation.

For your question of highest number, I assume I can caluculate the same in same dataset or in another dataset...

Please let me know, if I am missing answer to ur Q'n

Thanks
AR
Re: Reg dynamic parameter [message #896244 is a reply to message #896236] Tue, 17 July 2012 13:01 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You have a couple of options. Before you use the main dataset you could
add a hidden table that returns the all of the tables you want to union
and then store these in js vars which you then access in the beforeOpen
of your main dataset to modify the query. Or call the data engine api
directly and get the values to modify your query. I am attaching a
simple data engine api example in the beforeFactory.

Jason

On 7/17/2012 12:33 PM, A R wrote:
> No Jason, besides the versions are random sometime depending on
> architecture. I mean sometimes we may disbale few versions depending on
> situation.
>
> For your question of highest number, I assume I can caluculate the same
> in same dataset or in another dataset...
>
> Please let me know, if I am missing answer to ur Q'n
>
> Thanks
> AR
Re: Reg dynamic parameter [message #896786 is a reply to message #896244] Thu, 19 July 2012 14:45 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
Thanks for the response Jason. I am not clear with how to proceed the suggested option.

I have attached the modified example. In which I have created the dataset where I can access all the tables that I need to union. Creted parameter and variable, included one table where I have included the view_name.

Thanks
AR
Re: Reg dynamic parameter [message #896787 is a reply to message #896786] Thu, 19 July 2012 14:48 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
Thanks for the response Jason. I am not clear with how to proceed the suggested option.

I have attached the modified example. In which I have created the dataset where I can access all the tables that I need to union. Creted parameter and variable, included one table where I have included the view_name.

Thanks
AR
Re: Reg dynamic parameter [message #896806 is a reply to message #896787] Thu, 19 July 2012 17:20 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

In your main data set that will get the data you will need to enter a
query that gets all the expected column names. Say like:

select * FROM ASSET_REQUEST_29

Then in the beforeFactory you will create the rest of the query like:


mymodquery = "";
var ri = qr.getResultIterator( );
while ( ri.next( ) )
{
mymodquery = mymodquery + " UNION ALL ";
col1=ri.getValue("PRODUCTLINE");
mymodquery = mymodquery + " select * from " + col1
}

Then in the beforeOpen of the main data set put in

this.queryText = this.queryText + mymodquery;

Jason

On 7/19/2012 2:48 PM, A R wrote:
> Thanks for the response Jason. I am not clear with how to proceed the suggested option.
>
> I have attached the modified example. In which I have created the dataset where I can access all the tables that I need to union. Creted parameter and variable, included one table where I have included the view_name.
>
> Thanks
> AR
>
Re: Reg dynamic parameter [message #897641 is a reply to message #896806] Tue, 24 July 2012 17:02 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
Hi Jaosn - thanks for the response.

I am sorry for my ignorance. I tried the same approach but I am not able to understand how can I use of the dynamic query that script created. I am ataching the rpt design for the reference,which I am working.

Thanks
AR
Re: Reg dynamic parameter [message #897643 is a reply to message #896806] Tue, 24 July 2012 17:04 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
Thanks for the response Jason. I am not clear with how to proceed the suggested option.

I have attached the modified example. In which I have created the dataset where I can access all the tables that I need to union. Creted parameter and variable, included one table where I have included the view_name.

Thanks
AR
Re: Reg dynamic parameter [message #897657 is a reply to message #897643] Tue, 24 July 2012 19:52 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
Hello Jason, I am sorry. Now only I am getting slowy the above solution won't help me to achieve the requirement. I am trying this option to achieve the issue :

http://www.eclipse.org/forums/index.php/m/895607/#msg_895607

Please find the attahed qry for the dataset, that gives a static solution. Please let me know if any concerns.

Thanks
AR

[Updated on: Tue, 14 August 2012 14:33]

Report message to a moderator

Re: Reg dynamic parameter [message #898610 is a reply to message #897657] Thu, 26 July 2012 17:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Does the static solution address all your needs?

Jason

On 7/24/2012 7:52 PM, A R wrote:
> Hello Jason, I am sorry. Now only I am getting slowy the above solution won't help me to achieve the requirement. I am trying this option to achieve the issue :
>
> http://www.eclipse.org/forums/index.php/m/895607/#msg_895607
>
> Please find the attahed qry for the dataset, that gives a static solution. Please let me know if any concerns.
>
> Thanks
> AR
>
Re: Reg dynamic parameter [message #898807 is a reply to message #898610] Fri, 27 July 2012 13:23 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
Yes Jason, it caters aall my requirements.

Thanks
AR
Re: Reg dynamic parameter [message #899929 is a reply to message #898807] Thu, 02 August 2012 18:22 Go to previous messageGo to next message
A R is currently offline A R
Messages: 104
Registered: April 2012
Senior Member
Hi Jason - I am not able to workout the solution. Please suggest.

Thanks
AR
Re: Reg dynamic parameter [message #900075 is a reply to message #899929] Fri, 03 August 2012 15:55 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I am not certain on the issue you are having. I thought from your last
post you had it working.

Jason

On 8/2/2012 6:22 PM, A R wrote:
> Hi Jason - I am not able to workout the solution. Please suggest.
>
> Thanks
> AR
Previous Topic:Custom aggregation through the plugin via eclipse data extension point
Next Topic:Does birt support nested axis label
Goto Forum:
  


Current Time: Tue Jul 22 05:22:34 EDT 2014

Powered by FUDForum. Page generated in 0.02790 seconds