Multi criteria report

I would like to combine two standard AX reports into one. The reason they are currently two reports is that the criteria used are not compatible with each other.

Both reports use InventTrans table

Criteria 1 = Voucher = RS* (field starts with RS)

Criteria 2 = Voucher = *_083 (field ends with _083) AND Transtype = BOM line

The report subtotals per ItemId and has a grand total. Can anyone explain how this can be done please.

Hi,

in this case you’ll have to use advanced query ranges for your report. You will find more information about it HERE.

But basically somewhere in the initialization of your report you will have to adapt the query ranges to something like this:

QueryBuildDataSource dsInventTrans;

queryBuildRange queryBuildRange;

;

dsInventtRANS = yourReportQuery.dataSourceTable(tableNum(InventTrans));

queryBuildRange = dsInventtRANS.addRange(fieldNum(InventTable, DataAreaId));

queryBuildRange.value(strFmt(’((Voucher == RS*) || ((Voucher == *_083) && (TransType == “BOM”)))’));

Janis.

Thanks Janis but where do I add the code to the report please ?

Hi,

No offence, but do you have any reasonable AX development experience? If yes, then you would know where to put a code like this, but If you haven’t, then I’d better advice you to pass my solution description to a developer, because if you really don’t know where to put a code like this then you might actually do more harm than benefit to those existing reports :slight_smile:

Janis.

Hi Janis

No offence taken Janis, I appreciate your sentiment. My position with AX is as a user and as part of a implementation team (company side, not supplier).

I have limited knowledge so I document every addition, change etc I make to AX, when, why, at who’s request etc.

I never play with AX workings but build my own reports and occasionally need a little (or sometimes a lot) of help to reach my goal. Everything I have been able to do so far is self taught (AX books or web research).

I appreciate your comments and will try and figure where the code goes myself.

Thanks

Phil