Topic: Too Many IF Statements in one formula Posted: 11 Feb 2010 at 1:16pm
In one of my crystal report, I need to check too many parameters to assign a value to a formula. I write the code below (in basic syntax), but it is not working properly. In the report i can only see the value of the formula if it is in the first three cases. Formula does not gives "WAITING FOR ACCEPTANCE", "INSPECTION REJECTED", "IN INSPECTION", "IN RECEIVING", "IN CUSTOMS" values, It returns blank values instead of these values. But i can easly find lines that have to be one of these values. Also if i delete one of the elseif statement that works (for example: ELSEIF {BOMMAIN.TEMSEKLI} = "F" THEN FORMULA = "FURNISH" statement) then the next elseif statement starts to work and gives "WAITING FOR ACCEPTANCE" values.
Can anybody help me about this problem? Thanks in advance.
If {'SHORT_REPORT_'.STATU} = "REMNANT" OR {'SHORT_REPORT_'.STATU} = "TRANSFER" OR {'SHORT_REPORT_'.STATU} = "ALTERNATİF" OR {'SHORT_REPORT_'.STATU} = "METAR" OR {'SHORT_REPORT_'.STATU} = "NON-METALLIC" OR {'SHORT_REPORT_'.STATU} = "SC-PART" OR {'SHORT_REPORT_'.STATU} = "HARDWARE" OR {'SHORT_REPORT_'.STATU} = "FURNISH" THEN
FORMULA = {'SHORT_REPORT_'.STATU}
ELSEIF {VSUMSTOK.TPL_ALLOC_QTY1}>0 THEN
FORMULA = "IN STOCK"
ELSEIF {BOMMAIN.TEMSEKLI} = "F" THEN
FORMULA = "FURNISH"
ELSEIF {V_ACIK_PO_MUAYENE.KESIN_KABUL_BEKLEYEN} >0 THEN
FORMULA = "WAITING FOR ACCEPTANCE"
ELSEIF {V_ACIK_PO_MUAYENE.MUAYENE_RED}>0 THEN
FORMULA = "INSPECTION REJECTED"
ELSEIF {V_ACIK_PO_MUAYENE.GECICI_KABUL}>0 THEN
FORMULA = "IN INSPECTION"
ELSEIF {V_POITEM_CIKIS_MIKTAR.CIKAN_MIKTAR} - {V_MQT_PO_RR_QUANTITY.RECEIVEDQTY} > 0 THEN
FORMULA = "IN RECEIVING"
ELSEIF {ANTREPO.MIKTAR}>0 THEN
FORMULA = "IN CUSTOMS"
END IF
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum