Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 132768 - Total function does not work on Chart
Summary: Total function does not work on Chart
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 2.1.0 RC3   Edit
Assignee: Yulin Wang CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 141205
  Show dependency tree
 
Reported: 2006-03-21 22:05 EST by Sissi Zhu CLA
Modified: 2007-05-17 03:56 EDT (History)
2 users (show)

See Also:


Attachments
Design file (24.70 KB, text/plain)
2006-03-21 22:06 EST, Sissi Zhu CLA
no flags Details
flat file datasource (21.32 KB, text/plain)
2006-03-21 22:07 EST, Sissi Zhu CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sissi Zhu CLA 2006-03-21 22:05:26 EST
Description:
Add a Total.count() or Total.countDistinct() function on Value(Y) Series, error pop up when preview in layout.

Steps to reproduce:
1.Get the attached flat file as datasource, and open the attached design file.
2.There is a bar chart in the attached design file, set the "Optional  Y Series Grouping"  as row["component"], bind Value(Y) Series with "Total.countDistinct(row["bug_id"],null,1)", and set Category (X) Series as "row["component"]".
3.Preview in the dssigner, error pop up.
Comment 1 Sissi Zhu CLA 2006-03-21 22:06:32 EST
Created attachment 36712 [details]
Design file
Comment 2 Sissi Zhu CLA 2006-03-21 22:07:06 EST
Created attachment 36713 [details]
flat file datasource
Comment 3 David Michonneau CLA 2006-03-23 02:45:51 EST
We need to remove Total from the expression builder inside the Chart, as it is 
not supported by the charting engine, nor report engine.
Comment 4 Wenfeng Li CLA 2006-04-13 23:13:32 EDT
If DtE adds a scriptable objects for Total and engine adds them to the report scripting scope, can chart run this expression in that scripting scope that engine passes to Chart?
Comment 5 David Michonneau CLA 2006-05-08 03:08:02 EDT
Yes, however the scripting scope is not passed to the chart. The engine 
provides IRowSet.evaluate(String) method to evaluate javascript expressions, 
which is used by the chart engine. If this IRowSet can evaluate the Total 
function, then it will work.

Please note that the chart is unaware of the meaning of "total" or any other 
script expression, so setting total won't automatically group the chart series. 
Also this could possibly cause problems if a user uses Total on a Series and 
set grouping on the chart to group the series as the data will be aggregated 
twice: once by the chart engine, once by the report engine. Currently grouping 
inside the chart is not handled by the DtE but chart engine, so this total 
function cannot work at the chart grouping level (although it can work on the 
chart dataset level, which might be useful in some cases). We need to examine 
if this might not confuse the user.
Comment 6 Wenfeng Li CLA 2006-05-08 22:12:35 EDT
can we remove the total functions from the expression builder in chart in RC3?
Comment 7 David Michonneau CLA 2006-05-10 12:01:44 EDT
Please disable total in chart expression builder
Comment 8 Yulin Wang CLA 2006-05-11 03:07:00 EDT
Added an expression filter to remove Total expression
Comment 9 Sissi Zhu CLA 2006-05-12 04:39:52 EDT
Resolved.
Comment 10 Yulin Wang CLA 2007-05-17 01:39:49 EDT
Since Total has been supported in report engine, chart builder will enable Total function in expression builder since 2.2RC2.
Comment 11 Yulin Wang CLA 2007-05-17 03:56:36 EDT
Update of last comments:
We will deprecate Total function in all scripts. Users need to define all aggregations using databindings.
So Total is still invisible in expression builder.