| Summary: | Aggregation value is null when no line returned in the dataSet | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Anne Racine <ara> | ||||||
| Component: | BIRT | Assignee: | Birt-Data-inbox <Birt-Data-inbox> | ||||||
| Status: | NEW --- | QA Contact: | Xiaoying Gu <bluesoldier> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | bluesoldier, robert.aust, tietjen | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 2.5.2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows Vista | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
I can not reproduce this issue with 2.5.2 release. Please fine the attached sample report and preview. The aggregation on last line show 0 when previewing. Created attachment 194333 [details]
dataset using sampledb
Created attachment 194462 [details]
Report file with aggregation
I don't reproduce it either in preview mode, only when running in the application, after deployment. (In reply to comment #4) > I don't reproduce it either in preview mode, only when running in the > application, after deployment. Were you using the WebViewerExample birt runtime for deployment? And which application server do you deploy the birt on? Thanks for your investigation, sorry for my imprecision... The application server is JBoss 4.2.2. (In reply to comment #6) > Thanks for your investigation, sorry for my imprecision... > The application server is JBoss 4.2.2. I can not open your report design with 2.5.2 all-in-one release build. Could please create the report design again? BTW, can you reproduce this issue with my report which is using the sample database? Thanks to you report file, I found out the difference between our reports.
The difference is that I created the aggregation directly from the cell, using the "Aggregation" item from the context menu.
This creates the data directly in the cell (no need to create another data and do the binding).
And it works, unless there is no data in the data set !
Does it mean that I should add a data in all my reports ?
Thanks for your help.
Initial mine contained :
<structure>
<property name="name">user_count</property>
<property name="dataType">integer</property>
<property name="aggregateFunction">COUNT</property>
<list-property name="arguments">
<structure>
<property name="name">Expression</property>
<expression name="value" type="javascript">row["user_code"]</expression>
</structure>
</list-property>
</structure>
New mine, with 0 displayed, contains :
<structure>
<property name="name">Aggregation</property>
<property name="dataType">integer</property>
<property name="aggregateFunction">COUNT</property>
<list-property name="arguments">
<structure>
<property name="name">Expression</property>
<expression name="value" type="javascript">row["user_code"]</expression>
</structure>
</list-property>
</structure>
<structure>
<property name="name">user_count</property>
<expression name="expression" type="javascript">row["Aggregation"]</expression>
<property name="dataType">integer</property>
</structure>
(In reply to comment #8) > The difference is that I created the aggregation directly from the cell, using > the "Aggregation" item from the context menu. > This creates the data directly in the cell (no need to create another data and > do the binding). > And it works, unless there is no data in the data set ! > > Does it mean that I should add a data in all my reports ? > > Thanks for your help. I have the same problem. If I add the aggregation directly to the cell or if I add the aggregation as a computed column, nothing is displayed if the result is 0. If I add a data to the cell and add the aggregation this way, the 0 is displayed. Adding a data is a workaround for this, but rather inconvenient in large reports using a lot of aggregations. |
Build Identifier: 20100617-1415 When using COUNT aggregation with Birt 2.5.1, if no line in the dataSet, the value equals 0. With Birt 2.5.2, value is null. Example : DataSet : "Select code from customer" Data Aggregation : Count (expression = row["code"]) If table customer empty, value = 0.0 with Birt 2.5.1 value = null with Birt 2.5.2 Reproducible: Always Steps to Reproduce: 1.Create a dataSet on an empty table. 2.Create an aggregation with function COUNT. 3.Display the data aggregation.