How to handle Long decimal data in Smartform


Badge +1

I have created a smartobject that is fecthing data from SQL server. One of the data is of type decmial(30,10).

 

The problem is when I am displaying this data in smartform and the value is greater than 999999999 then I am getting error message that can not conlvert sql.decimal to source data type which is decimal.

 

Is there any workaround of this?


13 replies

Userlevel 3
Badge +10

I am able to use SQL type decimal(30,10) values without issue.

  11774i8F129EBA648BC96E.png


 


Could you post a screenshot of the error and maybe describe the situation in a bit more detail?

Badge +10

I believe this issue is more on the smartform side Jon.  The decimal data type in smartforms seems to only support 4 decimal places.

Userlevel 3
Badge +10

@Mike_K2 The screenshot is from a dropdown control on a SmartForm that references a SQL SmartObject.

Badge +10

I never make it past the service tester.  I did have some success creating a form around the smartobject, but only when I set the field where the number's destination was a text field.  Using the decimal data type in the list view produced an error involving StringToNumber conversion.

 

11616i5F52FD5EC5BF9EF6.png

 

Let me know what you find,

 

Regards,

 

Mike

Userlevel 3
Badge +10

@Mike_K2 Which blackpearl and SmartForms versions are you using?


 

Badge +10

Jon,

 

I'm using 4.6.8/1.0.7

 

The plot thickens a bit however.

 

I've noticed if there is anything in either the 1's, tenths, hundreths, or thousandths place it works without error:

EX)

1.00005 - works

0.10005 - works

0.01005 - works

0.00105 - works

0.00015 - works

0.00005 - breaks

 

I'm currently attempting to see if this is just an issue specific to SQL or if it persists with smartbox objects as well.

 

Regards,

 

Mike

 

Edit:  Well this is interesting...

 

14709i8E7869FDED039930.png

 

@ @AnilM, in the meantime, as I suggested to another user who is having a similar issue, his with extremly small values instead of extremley large, I'd reccomend having K2 pull the data in as text via the smartobject, then, if you need to run mathematical calculations, using one of the conversion inline functions such as ToDouble in order to preform math on it.

Userlevel 3
Badge +10

@Mike_K2 Same thing works for me.  The default list view truncates after the 2nd decimal place by default, but I changed the List View's column style from "Number" to "None" and it shows the full values, including 0.00005.  I am using 4.6.7 though, so I'll try to reproduce on 4.6.8 to see if it's a problem with the versions.

Userlevel 3
Badge +10

@AnilM  Could you confirm your blackpearl and SmartForms version?  This is looking to be an issue with 4.6.8.

Badge

@JonathanT I am using smartform version 1.0.6.

 

This issue is only occuuring if I am using a stored procedure as smartobject to return decmal value of length more than 9  using

 

Select * from ...

 

If I am using table as smartobject then it is working fine.

 

Any Idea what could be the issue?

Badge

Blackpearl version is 4.6.7

Userlevel 3
Badge +10

@anilmaskara Thank you for the info.  I will log a bug report with Support regarding this issue.

Userlevel 3
Badge +10

For anyone looking for a solution to this issue, it is a bug that occurs when 4.6.7 and below SmartObjects created from SQL stored procedures return decimal data with over 9 digits before the decimal point.  It throws the following error: "The given value of type SQLdecimal from the datasource can not be converted to type decimal of the specified target column."


 


This issue is fixed in blackpearl 4.6.8.

Badge +4

I got this error today (in our shop we are not ready to upgrade and we're still on 4.6.7) and like  @Mike_K2  said, I was not able to get past the smart object tester, so, my solution was to use convert on SQL and send back a view.  Oh well!

 

Taffy 

Reply