Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Bit Data Type Conversion
litojulian
Hi,<br />
<br />
I have a record which is in <strong class='bbc'>bit data</strong> type(example: F2F0F0F9F0F8F0F4, F1F3F6F5F1F7) How to display the record omitting letter "F"?, end result should be 20090804, 136517.<br />
<br />
I had tried this method in initialize script...<br />
function mySplit(str){<br />
var myString = str;<br />
var mySplitResult = myString.split("F");<br />
return mySplitResult;<br />
} <br />
<br />
and i got this error<br />
<br />
The following items have errors: <br />
<br />
<br />
Data (id = 198): <br />
+ A BIRT exception occurred. See next exception for more information.<br />
Error evaluating Javascript expression. Script engine error: Java class "[B" has no public instance field or method named "split".<br />
Script source: null, line: 0, text:<br />
<compiled script> (Element ID:198) <br />
<br />
..... any idea? Thanks
Find more posts tagged with
Comments
JasonW
Where are you getting the data from and what data type does BIRT list it as?
Jason
litojulian
Hi Jason,
I am getting from AS400, char() for bit data(8). The record sample is F2F0F1F2F0F6F2F0, when i use blob type it display as it is is F2F0F1F2F0F6F2F0, but when use String it display FFFFFFF2 FFFFFFF0 FFFFFFF1 FFFFFFF2 FFFFFFF0 FFFFFFF6 FFFFFFF2 FFFFFFF0. Just wasted to out 20120620.
Thanks
litojulian
Hi, I had tried this approach and it works:<br />
<br />
Edit Expressions:<br />
<br />
var mystring = new Packages.java.lang.String(dataSetRow["yourField"], "IBM01140");<br />
mystring;<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="'litojulian'" data-cid="106483" data-time="1341191907" data-date="01 July 2012 - 06:18 PM"><p>
Hi Jason,<br />
<br />
I am getting from AS400, char() for bit data(8). The record sample is F2F0F1F2F0F6F2F0, when i use blob type it display as it is is F2F0F1F2F0F6F2F0, but when use String it display FFFFFFF2 FFFFFFF0 FFFFFFF1 FFFFFFF2 FFFFFFF0 FFFFFFF6 FFFFFFF2 FFFFFFF0. Just wasted to out 20120620.<br />
Thanks<br /></p></blockquote>
JasonW
So it is working?
Jason