BIRT Exchange Forum: Bit Data Type Conversion - BIRT Exchange Forum

Jump to content


 

BIRT Poll: To best make a table fill a pdf page before breaking (PL=page layout, PBI=page break interval) set:

PL: auto, PBI: 0PL: fixed, PBI: 0PL: auto, PBI: 1000000PL: fixed, PBI: 1000000
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Bit Data Type Conversion Rate Topic: -----

#1 User is offline   litojulian Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 04-June 12


Posted 28 June 2012 - 05:45 PM

Hi,

I have a record which is in bit data type(example: F2F0F0F9F0F8F0F4, F1F3F6F5F1F7) How to display the record omitting letter "F"?, end result should be 20090804, 136517.

I had tried this method in initialize script...
function mySplit(str){
var myString = str;
var mySplitResult = myString.split("F");
return mySplitResult;
}

and i got this error

The following items have errors:


Data (id = 198):
+ A BIRT exception occurred. See next exception for more information.
Error evaluating Javascript expression. Script engine error: Java class "[B" has no public instance field or method named "split".
Script source: null, line: 0, text:
<compiled script> (Element ID:198)

..... any idea? Thanks
0

#2 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 29 June 2012 - 11:19 AM

Where are you getting the data from and what data type does BIRT list it as?

Jason
0

#3 User is offline   litojulian Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 04-June 12


Posted 01 July 2012 - 05:18 PM

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
0

#4 User is offline   litojulian Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 04-June 12


Posted 01 July 2012 - 06:38 PM

Hi, I had tried this approach and it works:

Edit Expressions:

var mystring = new Packages.java.lang.String(dataSetRow["yourField"], "IBM01140");
mystring;


View Postlitojulian, on 01 July 2012 - 05:18 PM, said:

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

0

#5 User is offline   JasonW Icon

  • Senior Member
  • Icon
  • View blog
  • Group: Administrators
  • Posts: 2505
  • Joined: 08-August 07


Posted 02 July 2012 - 02:44 PM

So it is working?

Jason
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users