HI,
I have been trying to create a report, which contains a simple table with 3 columns. the datasource used for the table is a script which is as follows:
#data['myKey']='Example'
thisWeek = system.tag.readBlocking([
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - MON/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - MON/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - TUE/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - TUE/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - WED/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - WED/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - THU/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - THU/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - FRI/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - FRI/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - SAT/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - SAT/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - SUN/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME THIS WEEK - SUN/EnableStart'
])
nextWeek = system.tag.readBlocking([
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - MON/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - MON/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - TUE/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - TUE/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - WED/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - WED/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - THU/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - THU/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - FRI/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - FRI/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - SAT/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - SAT/EnableStart',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - SUN/Start Timestamp',
'[IGNITION_TAGS]CONVEYOR/START TIMES/START TIME NEXT WEEK - SUN/EnableStart'
])
data['thisWeek'] = {
'Monday': {'startTime': thisWeek[0].value, 'enabled': thisWeek[1].value, 'colour': '00FF00' if thisWeek[1].value else 'FF0000'},
'Tuesday': {'startTime': thisWeek[2].value, 'enabled': thisWeek[3].value, 'colour': '00FF00' if thisWeek[3].value else 'FF0000'},
'Wednesday': {'startTime': thisWeek[4].value, 'enabled': thisWeek[5].value, 'colour': '00FF00' if thisWeek[5].value else 'FF0000'},
'Thursday': {'startTime': thisWeek[6].value, 'enabled': thisWeek[7].value, 'colour': '00FF00' if thisWeek[7].value else 'FF0000'},
'Friday': {'startTime': thisWeek[8].value, 'enabled': thisWeek[9].value, 'colour': '00FF00' if thisWeek[9].value else 'FF0000'},
'Saturday': {'startTime': thisWeek[10].value, 'enabled': thisWeek[11].value, 'colour': '00FF00' if thisWeek[11].value else 'FF0000'},
'Sunday': {'startTime': thisWeek[12].value, 'enabled': thisWeek[13].value, 'colour': '00FF00' if thisWeek[13].value else 'FF0000'},
}
data['nextWeek'] = {
'Monday': {'startTime': nextWeek[0].value, 'enabled': nextWeek[1].value, 'colour': '00FF00' if nextWeek[1].value else 'FF0000'},
'Tuesday': {'startTime': nextWeek[2].value, 'enabled': nextWeek[3].value, 'colour': '00FF00' if nextWeek[3].value else 'FF0000'},
'Wednesday': {'startTime': nextWeek[4].value, 'enabled': nextWeek[5].value, 'colour': '00FF00' if nextWeek[5].value else 'FF0000'},
'Thursday': {'startTime': nextWeek[6].value, 'enabled': nextWeek[7].value, 'colour': '00FF00' if nextWeek[7].value else 'FF0000'},
'Friday': {'startTime': nextWeek[8].value, 'enabled': nextWeek[9].value, 'colour': '00FF00' if nextWeek[9].value else 'FF0000'},
'Saturday': {'startTime': nextWeek[10].value, 'enabled': nextWeek[11].value, 'colour': '00FF00' if nextWeek[11].value else 'FF0000'},
'Sunday': {'startTime': nextWeek[12].value, 'enabled': nextWeek[13].value, 'colour': '00FF00' if nextWeek[13].value else 'FF0000'},
}
and from the script,the enabled key stores the boolean value, I want to display the value as a checkbox. as shown in the screen shot, but it does not give the proper output for example , even if the tag is true it returns unchecked box with green color as seen in the second image. what could be the reason for that, any suggestions?