Showing posts with label similar. Show all posts
Showing posts with label similar. Show all posts

Wednesday, March 7, 2012

How to Add an event to CRI controls

Hi all,

I am trying to develop a CustomReportItem similar to Matrix control. Is it possible to add some "OnClick" sort of events to a section of this CRI (As a drilldown button of matrix control allows to expand the respective column).

Please help me if there can be any solution.

I think it not possible to do that.

Report is web page , is not the application window.

sort the date, you can add a sort report parameters,

different parameters, show different matrix.

|||

Are you asking about design time or runtime?

While the CRI runtime control can generate drillthrough actions based on an image map, currently you cannot fully simulate the matrix group toggle behavior. You would rather need to work around it with report drillthrough actions and encoding the toggle state in parameter values.

-- Robert

|||

Hi Robert,

Thanks for ur response

I am asking it for runtime. How can I encode the toggle state in parameter values and how will it help to solve my problem? Please explain, as I am new to this tool.

|||

For every toggle icon, you could use a boolean report parameter to encode its state (e.g. expanded = true, collapsed = false). Another option is to encode the state of multiple toggles into an integer parameter (by using it as a bitfield) or maybe as string parameter.

For the CRI runtime control you would need to pass the parameter values as custom property values so that you can see the current toggle state (i.e. report parameter values) from within your CRI runtime code. Then you would need to draw the toggle icons as part of the image generated by the CRI runtime control. In addition you need to generate an image map over the toggle icon with a drillthrough action that drills to the same report with a report parameter value that has the opposite value of the currently drawn toggle state.

For example, if there is only one toggle and the toggle icon drawn is shown as expanded (with a report parameter representation as =True), you would add an image map area with a drillthrough action that passes the report parameter with the boolean value =False.

-- Robert

Friday, February 24, 2012

how to accumulate values in different columns ?

Hi,

I have a table similar to this :

id | name | res_id
--+---+---
1 | foo | 1
2 | bar | 1
3 | foo | 1
4 | test | 2
5 | wheyho | 3
6 | ding | 2
7 | dong | 3
8 | foo | 2
9 | foo | 3
10 | bar | 1
11 | bar | 2
12 | bar | 2
13 | wheyho | 3

Now, I am looking for a SELECT statement that counts the result_id depending on its value ( 1,2 or 3 in this example ) and grouped by name. To make it a bit more clear I am looking for this result (with result_id 1 evaluates to 'pass', 2 to 'fail' and 3 to 'unknown' ):

name | pass | fail | unknown
---+--+--+----
foo | 2 | 1 | 1
bar | 2 | 2 | 0
test | 0 | 1 | 0
wheyho | 0 | 0 | 2
ding | 0 | 1 | 0
dong | 0 | 0 | 1

I can get single results when doing this staements :

SELECT name, count(result_id) AS pass FROM t1 GROUP BY name, res_id HAVING res_id = 1;

name | pass
--+--
foo | 2
bar | 2

SELECT name, count(result_id) AS fail FROM t1 GROUP BY name, res_id HAVING res_id = 2;

name | fail
--+--
foo | 1
bar | 2
ding | 1
test | 1

SELECT name, count(result_id) AS unknown FROM t1 GROUP BY name, res_id HAVING res_id = 3;

name | unknown
---+---
foo | 1
wheyho | 2
dong | 1

Is there any way to bring these single results together with one SELECT statements ?With SUMs and CASEs:

SELECT
name,
SUM(CASE WHEN res_id = 1 THEN 1 ELSE 0 END) as pass
SUM(CASE WHEN res_id = 2 THEN 1 ELSE 0 END) as fail
SUM(CASE WHEN res_id = 3 THEN 1 ELSE 0 END) as unknown
FROM t1
GROUP BY name

Untested, syntax may be off.|||Wow, this was a fast reply! And, what is more, a very good one. It works just the way I was looking for !

thanks a lot !