Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » [SOLVED] reports calling themselves with multi-parameters from a chart(can a report call itself multiple times grouping data on different element)
icon14.gif  [SOLVED] reports calling themselves with multi-parameters from a chart [message #1277803] Wed, 26 March 2014 13:44 Go to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
Hi.

I am experimenting BIRT and wish to know if this is possible:

can a report call itself multiple times with an increasing numer of report parameters each time grouping data on different element.

Kind of a drill through, but within the same report. It has to be triggered by a mouse click event in a graph.

Thanks in advance for any answer.

Best regards.

Marc

[Updated on: Mon, 31 March 2014 16:54]

Report message to a moderator

Re: report calling themselves [message #1277819 is a reply to message #1277803] Wed, 26 March 2014 14:06 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Yes we can do this with a regular drillthrough action, i name this an "auto-drill" Smile I used this approach to sort a table on different columns, by clicking on the column title.

In your case you would need to declare a report parameter such "groupFieldName" and set this parameter as you like in your drillthrough actions. Then you should be able to make use of this parameter in your grouping expression.
Re: report calling themselves [message #1277825 is a reply to message #1277819] Wed, 26 March 2014 14:12 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
Thanks. It's not quite what I am looking for.

The thing is that in the first call, I want to see years, then months, then weeks and days, hours, minutes... Keeping the parameters as we go along.



  • It's like the first time around on a report I need no parameter, grouping on years
  • The second report call, I need to know for what year, grouping on month
  • Then the year AND month, grouping on week
  • etc


I forgot to mention that this needs to be from the interactivity option of a chart... Where there is only one category variable passed per click.

Is this at all possible?

[Updated on: Wed, 26 March 2014 16:51]

Report message to a moderator

Re: report calling themselves [message #1278369 is a reply to message #1277825] Thu, 27 March 2014 08:32 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
In interactivity of a chart we can define regular drillthrough actions, i don't see why you only have access to a category variable? May be you make use of "Invoke script" interactivity action, when we have to use "Hyperlink" action to define a drillthrough.

I think what you are trying to do is possible,for example we should declare:
- a report parameter per level (Year, Month, Week, Day,..), and set for each one a default value such -1 meaning "no filter".
- a report parameter to identifiy the current level, with a default value to 1 (Years)

- The dataset should be defined consequently, to ignore filters when the value of the relevant report parameter is -1. There are several options to achieve this, depending on the type of a datasource.

- Drillthrough actions should send :
---- all levels as report parameters
---- report parameter current level ++

Within drilltrhrough actions, for each level expression we need to test the current level to decide if we send:
- value from the dataset binding (if this level is the current level)
- current report parameter value of the level (else)

[Updated on: Thu, 27 March 2014 08:33]

Report message to a moderator

Re: report calling themselves [message #1278498 is a reply to message #1278369] Thu, 27 March 2014 12:17 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
Hi donino donino

I understand what you mean. But how should I go about grouping at different levels? I check for the parameter level and javascript my way to defining what field from the dataset I want to group with?

Best regards

Marc
Re: report calling themselves [message #1278600 is a reply to message #1278498] Thu, 27 March 2014 15:17 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Quote:
But how should I go about grouping at different levels? I check for the parameter level and javascript my way to defining what field from the dataset I want to group with?


Marc,

For dynamic grouping i was actually thinking to the native group expression. Usually, in this expression we set a simple stuff such image below.
index.php/fa/17851/0/

But in your case, if all column levels are present in the dataset it could be something like:

//Firstly we have to find out which column should be grouped
var groupingField="yearField";

if (params["level"]==2){
  groupingField="monthField";
}else if (params["level"]==3){
  groupingField="weekField";
}

//now we actually return the grouping value
row[groupingField];


Though there are many other options to achieve this, solving the problem in the before open script of the dataset as you suggested, or through a computed column of the dataset would also be fine.
Re: report calling themselves [message #1278706 is a reply to message #1278600] Thu, 27 March 2014 18:42 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
I don't have such a grouping option, here is what I have: see attached image


I am in the chart creation screen and the grouping option I have is called "Grouping and sorting" and I can't put any javascript expressions in it as per your example.
https://www.eclipse.org/forums/index.php/fa/17853/
I am startled

Marc
  • Attachment: Chart.jpg
    (Size: 87.00KB, Downloaded 2632 times)

[Updated on: Thu, 27 March 2014 18:51]

Report message to a moderator

Re: report calling themselves [message #1278714 is a reply to message #1278706] Thu, 27 March 2014 19:00 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member


Sorry for this post, I fixed my dataset problem.

[Updated on: Thu, 27 March 2014 19:30]

Report message to a moderator

Re: report calling themselves [message #1278732 is a reply to message #1278714] Thu, 27 March 2014 19:31 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
Hi again donino donino.

I fail to see how I am able to pass a "new parameter"'s value upon clicking on the graph with my interactive drillthrough option selected.

Can you guide me a little in this portion?

Best regards.
Re: report calling themselves [message #1278744 is a reply to message #1278732] Thu, 27 March 2014 19:54 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Hi Marc,

Parameters should be automatically suggested by Eclipse designer, if they are declared as report parameters of the target report (which is in your case also the current report!)

Here is an example of a drillthrough action defined in a bubble chart. Could you precise at which stage your are currently stuck?


index.php/fa/17854/0/

[Updated on: Thu, 27 March 2014 19:57]

Report message to a moderator

Re: report calling themselves [message #1279232 is a reply to message #1278744] Fri, 28 March 2014 12:36 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
I have done as you are showing, the thing is I don't know how to tell my parameters to change when I click on my bars in my charts.

Like I call the report with &level=1
then, when I click on a year, how do I tell the parameters to change to &level=2&year=2012
then, after that &level=3&year=2012&month=7

As of now, when I click a year, I circle back to the same level in my report.

I am stuck at that level.

Thanks in advance for all your PRECIOUS help.

Regards

Marc
  • Attachment: Chart.jpg
    (Size: 151.14KB, Downloaded 230 times)

[Updated on: Fri, 28 March 2014 12:43]

Report message to a moderator

Re: report calling themselves [message #1279778 is a reply to message #1279232] Sat, 29 March 2014 07:56 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Hi,

By looking at your screenshot, may be the "niveau" report parameter should be defined as Integer datatype it would be easier to handle.

That said, in this drillthrough action we should drill to the next level by sending an expression for "niveau" such:

params["niveau"].value+1;


For other drillthrough parameters
- if it is the current level we should send the clicked value of the chart
- otherwise we send the existing report parameter value. For example with "annee" parameter, if we also have a column "annee" in the dataset it would be:

if (params["niveau"].value==1){
  row["annee"];
}else{
  params["annee"].value
}


and so on for other drillthrough parameters. I hope it helps
Re: report calling themselves [message #1281147 is a reply to message #1279778] Mon, 31 March 2014 12:34 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
donino donino wrote on Sat, 29 March 2014 03:56

That said, in this drillthrough action we should drill to the next level by sending an expression for "niveau" such:

params["niveau"].value+1;


HAHA! That is where I am stuck.

Where should this code go? In the script section of the base url script? in the mouseclick section? I can't code javascript in there because I now have a drill through action that prevents me.

[Updated on: Mon, 31 March 2014 12:36]

Report message to a moderator

Re: report calling themselves [message #1281263 is a reply to message #1279778] Mon, 31 March 2014 16:17 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
donino donino wrote on Sat, 29 March 2014 03:56

That said, in this drillthrough action we should drill to the next level by sending an expression for "niveau" such:

params["niveau"].value+1;


HAHA! That is where I am stuck.

Where should this code go? In the script section of the base url script? in the mouseclick section? I can't code javascript in there because I now have a drill through action that prevents me.
Re: report calling themselves [message #1281275 is a reply to message #1281263] Mon, 31 March 2014 16:39 Go to previous messageGo to next message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Marc Arbour wrote on Mon, 31 March 2014 12:17
donino donino wrote on Sat, 29 March 2014 03:56

That said, in this drillthrough action we should drill to the next level by sending an expression for "niveau" such:

params["niveau"].value+1;


HAHA! That is where I am stuck.

Where should this code go? In the script section of the base url script? in the mouseclick section? I can't code javascript in there because I now have a drill through action that prevents me.


This code goes in the value expression of your drillthrough parameter "niveau". See this example, by editing or double-clicking a drillthrough parameter it displays an expression builder. Most of the time we just map it to a report parameter or a column binding, but we can also build complex expressions with loops, conditions, declare variables etc. In your case, just increment report parameter "niveau".

Let me know if it helps.

index.php/fa/17867/0/

[Updated on: Mon, 31 March 2014 16:56]

Report message to a moderator

Re: report calling themselves [message #1281282 is a reply to message #1281275] Mon, 31 March 2014 16:54 Go to previous messageGo to next message
Marc Arbour is currently offline Marc ArbourFriend
Messages: 36
Registered: March 2014
Member
Dear donino donino,

Your help did the trick. I was able to drill into my own report to a total of 3 deep, plus the original first depth for a total of 4.

Thanks you very much for your help on this complicated one.

Best regards

Marc Arbour
Re: report calling themselves [message #1281288 is a reply to message #1281282] Mon, 31 March 2014 17:04 Go to previous message
donino donino is currently offline donino doninoFriend
Messages: 183
Registered: July 2011
Senior Member
Great! I admit drillthrough actions are pretty challenging to setup when starting out in BIRT, but it's very flexible

Best regards
Previous Topic:Need Help : Date report Parameter
Next Topic:org.eclipse.birt.report.service.api.ReportServiceException
Goto Forum:
  


Current Time: Fri Apr 26 08:32:05 GMT 2024

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

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

Back to the top