Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326789 - split() in a computed column preview different from displayed in report.
Summary: split() in a computed column preview different from displayed in report.
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.5.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7.0   Edit
Assignee: Birt-ReportEngine-inbox@eclipse.org CLA
QA Contact: Tianli Zhang CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-01 10:43 EDT by Chris Chubb CLA
Modified: 2011-05-26 13:33 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Chubb CLA 2010-10-01 10:43:43 EDT
I have a report with a number of computed columns, mostly the results of splitting a single data field into many report fields. For example
Field3Test:
     aField3 = row["Field3"].split("|");
     aField3.join("*");

The contents of Field3 are:
XSV||Mercedes-Benz|300M-V6|2006|WDBRF52H66A82XX|1741098|S560590497XX|~XSV||Jeep|Wrangle|1997|1J4FY29P7PP23XX|6613725|S560590497XX|

When I "Preview Results" in the Data Source Editor the output for Field3Test is:
XSV**Mercedes-Benz*300M-V6*2006*WDBRF52H66A82XX*1741098*S560590497XX*~XSV**Jeep*Wrangle*1997*1J4FY29P7PP23XX*6613725*S560590497XX*	

That's as expected. But, when I do a "Preview" on the report (or run it on the server), the output for Field3Test is:
*X*S*V*|*|*M*e*r*c*e*d*e*s*-*B*e*n*z*|*3*0*0*M*-*V*6*|*2*0*0*6*|*W*D*B*R*F*5*2*H*6*6*A*8*2*X*X*|*1*7*4*1*0*9*8*|*S*5*6*0*5*9*0*4*9*7*X*X*|*~*X*S*V*|*|*J*e*e*p*|*W*r*a*n*g*l*e*|*1*9*9*7*|*1*J*4*F*Y*2*9*P*7*P*P*2*3*X*X*|*6*6*1*3*7*2*5*|*S*5*6*0*5*9*0*4*9*7*X*X*|

So, obviously, the Split() parameter is being run as "null" or "" when the report is actually executing in order to split on every character. 

I checked the source of the .rptdesign file and the split() function is only in there once. I have tried using both single and double quotes with the split() function parameters. I have tried using a "raw" RegExp as .split(/\|/) but that doesn't split on anything in the output, returning a single string, though it still works fine in the "Preview Results" window.
Comment 1 Xiaoying Gu CLA 2010-10-08 03:43:39 EDT
Can not reproduce with the latest 2.6.1 release build.
Comment 2 Xiaoying Gu CLA 2010-10-11 05:57:50 EDT
Set as resolved based on comment #1.

Feel free to reopen if having any issues.