How to Filter enum without value (like All values Enum) in SSRS AX

Hii Master,

 

this's my code on processReport,

 

this's view form filter :

 

In my case, I want to filtering enum (All Values enum). but when I try like picture code in processReport, the Report Always selected status Created ?

Please, correct me if I wrong? and what should I do ?

  • Is the enum value for created is 0?
    If you remove the first if condition (for ALL), will it not run for all records?

  • In reply to Kranthi:

    You can also use sysQuery::valueUnlimited();
  • In reply to Kranthi:

    I did customize in enum, for enum value ( All =3, Created = 0, Shipped=1, Received=2)

    I have add code ValueUnlimited(), but Report Always show "created" status,? I try change enum value, (All =0, Created = 1, Shipped=2, Received=3) but when I select status All, data will show Created status  and I select Created data will show Shipped Status.

    please Correct my code, what the best practice for this case 

  • In reply to Pranyoto:

    Ok, are you getting the value in trasferStatus variable correctly?
  • In reply to Kranthi:

    The TransferStatus has different enum(InventTransferStatus) in that table. Instead, use InventTransferStatus::Created etc..
  • In reply to Kranthi:

    TransferStatus is variable of enum InventTransferStatus_Axl (enum customization)  on ClassDeclaration;

    InventTransferStatus_Axl   transferStatus;

     

    How can I select status "All", and data will showing All ? but this's code always run created.? What should I do, please correction my code if I wrong logic ?

     

    ----------This's code on processReport--------------

    if(transferStatus == InventTransferStatus_Axl::All)

       {

           q.dataSourceTable(tableNum(InventTransferTable)).addRange(fieldNum(InventTransferTable, TransferStatus)).value(SysQuery::valueUnlimited());

       }

       if(transferStatus == InventTransferStatus_Axl::Created)

       {

           q.dataSourceTable(tableNum(InventTransferTable)).addRange(fieldNum(InventTransferTable, TransferStatus)).value(queryValue(InventTransferStatus_Axl::Created));

       }

       if(transferStatus == InventTransferStatus_Axl::Received)

       {

           q.dataSourceTable(tableNum(InventTransferTable)).addRange(fieldNum(InventTransferTable, TransferStatus)).value(queryValue(InventTransferStatus_Axl::Received));

       }

       if(transferStatus == InventTransferStatus_Axl::Shipped)

       {

           q.dataSourceTable(tableNum(InventTransferTable)).addRange(fieldNum(InventTransferTable, TransferStatus)).value(queryValue(InventTransferStatus_Axl::Shipped));

       }

  • In reply to Pranyoto:

    Pranyoto
     q.dataSourceTable(tableNum(InventTransferTable)).addRange(fieldNum(InventTransferTable, TransferStatus)).value(queryValue(InventTransferStatus_Axl::Shipped));

    You code is correct, if the enum values are same. As you are mapping two different enums.

    I mean, if the enum value of InventTransferStatus_Axl::Shipped and InventTransferStatus::Shipped are same

  • In reply to Kranthi:

    I have ensured, Enum value not same. do you have alternative filtering enum value on report ?
  • In reply to Pranyoto:

    Pranyoto
    do you have alternative filtering enum value on report ?

    Not sure what does that mean?

  • In reply to Kranthi:

    I mean, Do you have a more efficient way of filtering enum values
  • In reply to Pranyoto:

    Have you tried below in the range value?
    InventTransferStatus::Shipped instead of InventTransferStatus_Axl::Shipped
    InventTransferStatus::Created instead of InventTransferStatus::Created
    InventTransferStatus::Received instead of InventTransferStatus::Received
Related
Recommended