Enabling and disabling field scriptcase reports

I working on a report for a school result management system , one of the requirements is to have to hide marks and average when the student is not doing the subject. i am able to hide the mark and postion using the following code

if ({OT} == “0”) {
{Office_Technology} = " ";
}

if ({OT} == “0”) {
{Rank_OT} = " ";

where “0” denotes that the student is not doing the subject however i have added fields to generate average but it does not seem to hide the field , is there any way i use a marco in script case report to hide the fields

the averge is query

SELECT NULLIF(ROUND(AVG(Office_Technology)),0) AS AVGOT FROM tblexam_master_sub where Year = ‘{Year}’ and Class =’{Class}’ and Cal_Year = ‘{Cal_Year}’ and Term =’{Term}’ and OT =‘1’

have you tried sc_field_display(Rank_OT,off) ?

no i will try that today

i tried it does not work on reports

On the docs it is supposed to be able to work on event On ScriptInit.

This is on report and it not working I will attached pic of development environment

They really limit you on the PDF report.

it DOES work on a grid…
so how about this… make your report in a Grid application, then set the Initial Module to be PDF