Setting a Checkbox value depending on database values

Stimulsoft Reports.NET discussion
Post Reply
Sanseviera
Posts: 3
Joined: Fri May 19, 2017 8:46 am

Setting a Checkbox value depending on database values

Post by Sanseviera »

Hello,

I am trying to set a checkbox value depending on the value of a field returned from the database. I am using the following code in the
BeforePrint Event:

CheckBox5_8_Nein.Checked = IIF(LINK_Audit_umfasst_Prüfpunkt.Point_to_check.ja__nein_Frage != "yes",true,false);

but I am getting errors. I have tried other ways of doing it with STIExpression (as an object) and trying to convert that to boolean
but I am getting nowhere. There is only 1 forum entry for how to set a checkbox value in code but that actually doesn't provide a solution
either.

Can anyone please show me how to simply set the checkbox value above?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Setting a Checkbox value depending on database values

Post by Edward »

Hi Sanseviera,

Please set the CheckedValue property instead.
CheckedValue.mrt
(5.77 KiB) Downloaded 410 times
CheckBox_CheckedValue.PNG
CheckBox_CheckedValue.PNG (57.17 KiB) Viewed 2521 times
Thank you,
Edward
Sanseviera
Posts: 3
Joined: Fri May 19, 2017 8:46 am

Re: Setting a Checkbox value depending on database values

Post by Sanseviera »

Thank you very much Edward, I will give this a try and let you know.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Setting a Checkbox value depending on database values

Post by Alex K. »

Hello

We are always glad to help you!
Please let us know if you need any additional help.

Thank you.
Post Reply