Convert string to Int or double

Stimulsoft Reports.NET discussion
Post Reply
atryass
Posts: 33
Joined: Mon Sep 15, 2008 7:42 am
Location: Iran

Convert string to Int or double

Post by atryass »

Hi
I want to convert a string into Int in Text Editor but I don't know how?
In my report I want to div to value of Text component but I can't do this.
Plz help me.
tanx
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Convert string to Int or double

Post by Jan »

Hello,

You can use following codeL

Code: Select all

int.Parse(value)
Thank you.
atryass
Posts: 33
Joined: Mon Sep 15, 2008 7:42 am
Location: Iran

Convert string to Int or double

Post by atryass »

Tanx Jan
But I use the following code in Text17 in my report

Code: Select all

{Div(double.Parse(Text15.Text),double.Parse(Text18.Text))}
but when run my report this error occuerd:
Expression in Text property of 'Text17' can't be evaluated!
how can I solve this problem?
if is it true that convert this code to string?(how convert to string?)
PLZ help me!
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Convert string to Int or double

Post by Ivan »

Hello,
atryass wrote:But I use the following code in Text17 in my report

Code: Select all

{Div(double.Parse(Text15.Text),double.Parse(Text18.Text))}
but when run my report this error occuerd: ...
Best way to solve this issue:
If Text15 contain expression {yourDataSource.Field1} and Text18 contain expression {yourDataSource.Field2},
then please write in Text17 following expression:

Code: Select all

{Div(yourDataSource.Field1, yourDataSource.Field2)}
Thank you.
atryass
Posts: 33
Joined: Mon Sep 15, 2008 7:42 am
Location: Iran

Convert string to Int or double

Post by atryass »

Hi
tanx Ivan
but my Text17 is a sum of column in a group!and it is not a field from my data source.

Code: Select all

{Sum(GroupHeaderBand1,vTimeSheetPlan.ActualWork_Hour)}
How can solve this problem?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Convert string to Int or double

Post by Ivan »

Hello,
atryass wrote:but my Text17 is a sum of column in a group!and it is not a field from my data source.

Code: Select all

{Sum(GroupHeaderBand1,vTimeSheetPlan.ActualWork_Hour)}
How can solve this problem?
If Text15 contain expression {Sum(GroupHeaderBand1,vTimeSheetPlan.ActualWork_Hour)} and Text18 contain expression {yourDataSource.Field2},
then please write in Text17 following expression:

Code: Select all

{Div(Sum(GroupHeaderBand1,vTimeSheetPlan.ActualWork_Hour), yourDataSource.Field2)}
Thank you.
ram
Posts: 1
Joined: Tue Apr 20, 2021 11:10 am

text having more than 10 dogits is not displaying

Post by ram »

I have a text field, from json iam binding a number to that field, it is displaying if number has 10 digits but if number has more than 10 digits the text field is not displaying. iam using 2021.2.2 version.
In 2019 version it is working properly
Lech Kulikowski
Posts: 6197
Joined: Tue Mar 20, 2018 5:34 am

Re: Convert string to Int or double

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis on support@stimulsoft.com

Thank you.
Post Reply