Adding huge numbers as general text shows as numbers

Stimulsoft Reports.WEB discussion
angelcalvasp
Posts: 25
Joined: Fri Nov 10, 2017 9:48 pm

Re: Adding huge numbers as general text shows as numbers

Post by angelcalvasp »

Sorry previous json data was wrong here is the files for assessment
Attachments
ridetest.json
(215.15 KiB) Downloaded 140 times
Ride.mrt
(88.72 KiB) Downloaded 130 times
angelcalvasp
Posts: 25
Joined: Fri Nov 10, 2017 9:48 pm

Re: Adding huge numbers as general text shows as numbers

Post by angelcalvasp »

If anybody reads this, until I get a response here, a workaround was to use Mid
{Mid(root.documento_numero_autorizacion,1,49)}

and had to add a non numeric character at the beginning of the string value from the json

worked for both the normal text and the barcode
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Adding huge numbers as general text shows as numbers

Post by HighAley »

Hello.

Thank you for sharing the solution to the problem.
angelcalvasp
Posts: 25
Joined: Fri Nov 10, 2017 9:48 pm

Re: Adding huge numbers as general text shows as numbers

Post by angelcalvasp »

Still needs to be checked tho shouldnt need to do workarounds :D
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Adding huge numbers as general text shows as numbers

Post by Lech Kulikowski »

Hello,

We have added some improvements in the data parser. Will be available in the next release.

Thank you.
speter@techgroup.ch
Posts: 1
Joined: Tue Dec 06, 2016 10:51 am

Re: Adding huge numbers as general text shows as numbers

Post by speter@techgroup.ch »

Hello,

If anyone reads this, we just had the same problem with version Stimulsoft.Reports.Engine 2020.2.2 and Stimulsoft.Reports.Engine.NetCore 2020.2.3.

We used a similar workaround as described by the opener. The problem lies actually within the Library in the class StiJsonToDataSetConverter.cs which is from your NuGet package.

There is a function "private static Type ParseString(string str)" which tries to evaluate the column-type from the value. So if you have "914829300005910214860" as a value, it will be converted into a "double" type which ends up as "9.148293000059102E+20" in the report.

So the problem is not in the .mrt file, it is in the NuGet library in our case. In my opinion, the column-type should not be evaluated from the value, but from the data type of the property.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Adding huge numbers as general text shows as numbers

Post by Lech Kulikowski »

Hello,

Please try to use StiJsonToDataSetConverterV2

Thank you.
Post Reply