mardi 16 février 2016

Incrementing An Array Crystal Report

I have a user inputted parameter that can be 1 value up to how ever many values they enter. Right now where [i] is in the formula that is the index of the array of how many they enter. I need to increment the formula so that it iterates over every one of their parameters but no more than what they enetered. I tried hard coding indexes[1] through [20] but if there were fewer than 20 parameters entered I would get an error.

    if TONUMBER({?Order #}[i]) = TONUMBER({V_ORD_COMB.ORDERNO})
    then TRUE
    ELSE

    FALSE

This works fine for 1 input value but no more

    if TONUMBER({?Order #}[1]) = TONUMBER({V_ORD_COMB.ORDERNO})
    then TRUE
    ELSE

    FALSE

This works fine for 3 input values but no less or more

    if TONUMBER({?Order #}[1]) = TONUMBER({V_ORD_COMB.ORDERNO})
    then TRUE
    ELSE
    if TONUMBER({?Order #}[2]) = TONUMBER({V_ORD_COMB.ORDERNO})
    then TRUE
    ELSE
    if TONUMBER({?Order #}[3]) = TONUMBER({V_ORD_COMB.ORDERNO})
    then TRUE
    ELSE
    FALSE

I am trying to get it to work for any number of inputted parameters.

Aucun commentaire:

Enregistrer un commentaire