How to Add check box in Birt Report DEsigner

Hi i would like to know how to add checkbox in birt report designer.
i have added checkbox in maximo when i call the field in report it show 1 and 0 i want to display check box .

Answers

  • wwilliamswwilliams Junior Member

    This displays a checkbox and if the parameter is = 1 the checkbox is checked
    <form name="tasks"> <input type="checkbox" name="taskcheckbox" <VALUE-OF>if( params["checkit"].value==1){ "checked"; }else{ ""; }</VALUE-OF>>Task Complete</input> </form>

    I re-purposed some code from Jason Weathersby

  • wwilliamswwilliams Junior Member

    I guess the check boxes don't work when you convert to a PDF and I am guessing that is what you would want. I think it would be a pain, but you could create two image files and control visibility dynamically.

  • edited June 2018

    You beat me to the answer, wwilliams. I'll attach the example I created anyway and list the steps I followed:
    :
    1. Create a computed column in the data set to randomly generate Boolean values (just for testing).
    2. Create a second computed column in the data set to generate the checkbox state.
    3. Add a table to display the computed columns.
    4. Replace the second Data element in the table with a Text element.
    5. Change the Text element type to HTML and add HTML code to display a checkbox.
    6. Insert the row value containing the checkbox state in the HTML using the tag.

    An HTML tag will be generated for each row of the table and the computed state for that row will be inserted into the tag to set the box's checked state to the Boolean value.

    I don't think PDF's support functional checkboxes, and the emitter would need to support them as well, so this is just for web. Even for web, it isn't a functioning form. This is just a report.

    Jeff F.
    Customer Support Engineer I
    OpenText
  • Thanks guys i have got a solution which is very easy please see below.

    if(dataSetRow["Fieldname"]=="1")
    {
    String.fromCharCode(10003);
    }
    else
    {
    String.fromCharCode(10065);
    }

  • That's a great solution! Thanks for sharing it.

    Jeff F.
    Customer Support Engineer I
    OpenText
  • Hi Please check this is PDF conversion screenshot.

Sign In or Register to comment.