Skip to main content

How do I implement a checkbox on a report during runtime?

Comments

3 comments

  • Zack Robison
    I don't know about needing scripting, but you can use expressions in the properties for most of those controls.  I would try throwing an inline "If" in there and see what happens.
    0
  • Permanently deleted user
    Hi Erick,

     

    You would then need to add a “calculated field” with a formula that points to the dataField that you would like to use. As long that formula always has a Boolean result you’ll be fine.

     

    In your report template, in “controls” section there is check box object that can be placed in the “detail” area of the report. In dataField property of the checkbox place the name of your “calculated field” and it should work.

     

    For example I have a “STATUS” field that is a string. If the string contains a value I want checkbox ticked otherwise checkbox should be not ticked. Calculated field contains formula below

     

    ((STATUS + " ").ToString().Trim() != "" ? True : False)

     

    I hope this helps
    0
  • Permanently deleted user
    Thanks, Zach and Francesca. I was intially a little confused about how to implement your suggestions but I figured it out.To summarize, I created a calculated field for each check box control on the report by right-clicking the Fields...Calculated control on the upper right of the UI and choosing Add. I defined the calculated field type as a Boolean by choosing Boolean from the Field Type drop-down list. After naming the new calculated field (cfFloodplain in my example) I used the formula that Francesa suggested for the calculated field's Formula property (in my example I used ((Parcels.Floodplain + " ").ToString().Trim() != "No" ? True : False). This sets the boolean value of the calculated field based on the feature's data value (in my example all features have a value 'Yes' or 'No') . I then set the Datafield property of the checkbox control to the name of the calculated field on the report (cfFloodplain). That worked great! Thanks again.
    0

Please sign in to leave a comment.