Bug 183098 - Exception occurs when preview a crosstab include a filter[1102]
Summary: Exception occurs when preview a crosstab include a filter[1102]
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 2.2.0 RC0   Edit
Assignee: Birt-Data-inbox@eclipse.org CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-18 22:43 EDT by Tianli Zhang CLA
Modified: 2007-06-01 02:42 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tianli Zhang CLA 2007-04-18 22:43:21 EDT
Description:
Exception occurs when preview a crosstab include a filter[1102]

Build number: 
2.2.0.v20070418-0630

Steps to reproduce:
1, Specify a filter on the cross tab such as
   row["PRODUCTTYPE"] equals to "Baby"
2, Preview the results

Expected result:
All the Baby Products are shown

Actual result:
Exception occurs

Error log:
org.eclipse.birt.report.service.api.ReportServiceException: Error happened while running the report; nested exception is: java.lang.ClassCastException: org.eclipse.birt.report.model.api.FilterConditionHandle 
org.eclipse.birt.report.item.crosstab.core.re.CrosstabQueryHelper.addFilter(CrosstabQueryHelper.java:368)
org.eclipse.birt.report.item.crosstab.core.re.CrosstabQueryHelper.buildQuery(CrosstabQueryHelper.java:167)
org.eclipse.birt.report.item.crosstab.core.re.CrosstabReportItemQuery.createReportQueries(CrosstabReportItemQuery.java:80)
org.eclipse.birt.report.engine.data.dte.ReportQueryBuilder$QueryBuilderVisitor.visitExtendedItem(ReportQueryBuilder.java:435)
org.eclipse.birt.report.engine.ir.ExtendedItemDesign.accept(ExtendedItemDesign.java:37)
org.eclipse.birt.report.engine.data.dte.ReportQueryBuilder.build(ReportQueryBuilder.java:241)
...
Comment 1 Ivy Li CLA 2007-04-19 03:09:28 EDT
Change to use structure handle in the CrosstabQueryHelper. After made this change please assign to DtE to fix the NPE. 
Comment 2 Zhiqiang Qian CLA 2007-04-19 04:45:16 EDT
fixed in crosstab query helper, transfer to Dte for further fixing.
Comment 3 Tianli Zhang CLA 2007-04-20 05:23:32 EDT
If I set the filter on PRODUCT_TYPE Group leve, should I use the filter like that further:
dimension["PRODCUT"]["PRODUCT_TYPE"] equals to "Baby"
Comment 4 Lin Zhu CLA 2007-05-08 07:50:48 EDT
Fix the problem in Data.

Furthermore, in GUI, the reference to a cube column binding should be data["bindingName"] rather than row["bindingName"].

Reassign the bug to GUI for more corrections.

Comment 5 Wang Qiangsheng CLA 2007-05-08 18:09:42 EDT
How can gui know if we're referring a cube binding or none-cube binding?
Comment 6 Lin Zhu CLA 2007-05-09 08:24:14 EDT
The algorithm should similar to UI's creation of level reference expression dimension["dimName"]["lvlName"] and measure reference expression measure["measureName"]. The difference is that the prefix would be "data".
Comment 7 Wang Qiangsheng CLA 2007-05-09 19:45:46 EDT
Can dte or model provide a api to generate the expression?
That's really the thing GUI can know.
Thanks
Comment 8 Wang Qiangsheng CLA 2007-05-15 00:04:31 EDT
Moving to rc1 for blocking by dependencies of model.
Comment 9 Lin Zhu CLA 2007-05-15 06:56:50 EDT
The api is already in ExpressionUtil in core.
Comment 10 Chen Chao CLA 2007-05-15 08:07:55 EDT
Fixed it.
Comment 11 Rima Kanguri CLA 2007-05-17 14:28:20 EDT
Failed test - With May 17 build, I still see the issue. 
Comment 12 Rima Kanguri CLA 2007-05-17 17:12:54 EDT
There are two issues here in May 17 build.
(1) UI first needs to make sure the right expression is generated i.e data["Year"] is generated in filter instead of row["Year"]

(2) Data Engine - Even if I change the expression to data["Year"] manually, it still fails.

Comment 13 Tianli Zhang CLA 2007-05-17 21:37:35 EDT
I tested on the latest build, the dimension["PRODUCT"]["PRODUCT_TYPE"] works well, but the data["PRODUCT_TYPE"] failed
Comment 14 Wang Qiangsheng CLA 2007-05-17 22:22:49 EDT
Yes, gui generates the right expression.
Assign to DTE for item 2 of Rima.(In reply to comment #19)(In reply to comment #13)
> I tested on the latest build, the dimension["PRODUCT"]["PRODUCT_TYPE"] works
> well, but the data["PRODUCT_TYPE"] failed
> 

Comment 15 Lin Zhu CLA 2007-05-17 23:05:21 EDT
This bug is fixed in May 17 so will be ok for May 18 build.
Comment 16 Tianli Zhang CLA 2007-06-01 02:42:11 EDT
Verified on v20070601 build
closed and regards~