How to print data from indented DataItem without data from Filtered DI?

Dear all, I have an issue in a report I am creating.

I have two tables/DataItems with almost the same content. The structure of my DataItems is as follows: TableOne (with year, week, project no.)

Project Table (with project no., code)

TableTwo (with year, week, code)

Now tableOne can have data filtered based on year, week and project no. but not necessarily, while in table two there is data!

Now the problem is that I need to have the data from TableTwo in my report, but It will not be printed because the filtering of table one. Switching the DataItem structure (TableTwo first) is no option, because also table two might not contain data on year, week, code while TableOne does.

Does anybody know what to do about this?

Thanks in advance for your replies.


Hi Alex,

You can code this on the “OnPreDataItem” trigger of you “TableTwo” dataitem.

Hello Erik,

Thanks for your reply. I am not that much into C/AL Coding (used only a few). I imagined I should be doing something in the onpredataitem of my tabletwo. Can you perhaps give me a hint which code to use?

Thanks in advance for the reply.


It’s very simple, just use SETRANGE where you use the filters from the first table: