Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to concatenate number to string ?
mlotfi
Hi,
I am trying to display :
"The sequence number : " + dataSetRow["SEQUENCE_NUMBER"]
SEQUENCE_NUMBER is a number in oracle database, the above string does not want to work, can you plz help me on how to do it.?
thanks
Majid
Find more posts tagged with
Comments
mwilliams
Hi Majid,
Try:
"The sequence number : " + dataSetRow["SEQUENCE_NUMBER"].toString()
mlotfi
No it did not work, this is what I got :
The following items have errors:
Table (id = 10):
+ Fail to compute value from sort, group or filter expression.
A BIRT exception occurred: There are errors evaluating script "row["SEQUENCE_NUMBER"]":
The original dataType of value The sequence number : 2 is class java.lang.String which can not be converted to the assigned dataType class java.math.BigDecimal.. See next exception for more information.
There are errors evaluating script "row["SEQUENCE_NUMBER"]":
The original dataType of value The sequence number : 2 is class java.lang.String which can not be converted to the assigned dataType class java.math.BigDecimal.
data.engine.ScriptResult.WrongSystemComputedColumn ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: Fail to compute value from sort, group or filter expression.
A BIRT exception occurred: There are errors evaluating script "row["SEQUENCE_NUMBER"]":
The original dataType of value The sequence number : 2 is class java.lang.String which can not be converted to the assigned dataType class java.math.BigDecimal.. See next exception for more information.
There are errors evaluating script "row["SEQUENCE_NUMBER"]":
The original dataType of value The sequence number : 2 is class java.lang.String which can not be converted to the assigned dataType class java.math.BigDecimal.
pricher
Hi Majid,
From what I can see, you probably modified the SEQUENCE_NUMBER binding that was created automatically by BIRT when you created your table and bound the data set to it. Because SEQUENCE_NUMBER was initially created as an Integer, trying to concatenate a string to it and using this binding in a group, sort or filter will create a problem.
The best thing to do is to create a brand new binding with data type STRING. You can use the same expression
"The sequence number : " + dataSetRow["SEQUENCE_NUMBER"]
BIRT will automatically cast everything to a string.
Hope this helps,
P.
MGA1422
<p>thanks a lot Pricher.</p>