Changing the value in datasource????

Stimulsoft Reports.NET discussion
Post Reply
abhi0410
Posts: 47
Joined: Fri Sep 26, 2008 12:42 pm
Location: bombay

Changing the value in datasource????

Post by abhi0410 »

Hi...

In my datasource, in one column the data is returened is True or false and according to that i have to print yes or no.....

How to do???

i knw i have to use the event called before print but how to do????

i mean what code to write exactly to change the text????

in report the text is printed as True or false....

Please suggest soon...

Thanks...
Brendan
Posts: 309
Joined: Sun Jul 16, 2006 12:42 pm
Location: Ireland

Changing the value in datasource????

Post by Brendan »

You can use the Text Format property of the text component to format the values of your boolean column

Image
abhi0410
Posts: 47
Joined: Fri Sep 26, 2008 12:42 pm
Location: bombay

Changing the value in datasource????

Post by abhi0410 »

thanks...its working...
but i have another question....If it was not boolean and some word like 'xyz' and 'abc' and 'klm'......if i am getting these word in datasource...

n then i want to display some word against these word.....like instead of 'xyz' i want to display 'red' and yellow instead of 'abc'...

then how to do???? can't this done in beforeprint event with the help of 'if' statment?????

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Changing the value in datasource????

Post by Vital »

Hello,

You can use ternary operation in expression:

{MyDataSource.Value == true ? "Value1" : "Value2"}

Thank you.
cjemina
Posts: 2
Joined: Sat Oct 17, 2020 5:57 pm

Re: Changing the value in datasource????

Post by cjemina »

Hello,


How to implement this using Javascript?
Lech Kulikowski
Posts: 7341
Joined: Tue Mar 20, 2018 5:34 am

Re: Changing the value in datasource????

Post by Lech Kulikowski »

Hello,

Please check the following article:
https://stimulsoft.zendesk.com/hc/en-us ... cript-code

Thank you.
Post Reply