Report filters not working correctly


I have a report with 2 datasource. The first one is table MainAccount and the second one a custom View. Some of the tables that consist View are GeneralJournalAccountEntry,GeneralJournalEntry and DimensionAttributeValueCombination . When I run the report it seems that it takes filter parameters only from table MainAccount and not from the View, while relation is correct. I want to use specific Dimensions for filter and report ignore them. Meanwhile when I create a simple job, joining MainAccount and the custom View, filters work perfect.

Can you please help?

Please look at the actual query you’re sending to database - it’s likely something else than you think.

In Fetch method I use queryrun(this.query() ). So I use the query from the Report DataSource. But it does not read the filters from the second datasource.

thank you,

Does it mean that this object doesn’t contain some ranges that you expect there? In that case, the query must be taken / built somewhere else than you think, e.g. you added something in AOT and you expect it to be used, but the query used by the report is actually a saved query read from database.

If this doesn’t help you, you’ll have to tell us what you’re actually doing.


I decided to write the query in Fetch Method of Report. So I tried to make a job to test the code.

The problem now is, that while infolog returns the correct result set, I cannot pass correctly the queryrun as argument to class oReportManager*.createBalanceListTmp* . All records from MainAccount are passed and not olny the ones I have selected according to report criteria when I run it. (For example I select one MainAccount and specific Dimensions)

Code is below. Can you please help me?

static void LedgerBalance(Args _args)

Query query;
QueryRun queryrun;
QueryBuildDataSource qbds1;
QueryBuildDataSource qbds2;
QueryBuildRange qbr1;
QueryBuildRange qbr2;
LedgerTransView tLedgerTrans;

MainAccount tmainAccount;
GeneralJournalAccountEntry accEntry;
TmpBalanceList m_tTransactions;
ReportManager oReportManager ;


oReportManager = new ReportManager ();
query = new query();
qbds1 = query.addDataSource(tablenum(MainAccount));
qbds2 = qbds1.addDataSource(tableNum(LedgerTransView));

queryrun = new queryrun(query);
if (queryrun.prompt() )
while( )
tLedgerTrans = queryrun.get(tablenum(LedgerTransView));
tmainAccount= queryrun.get(tablenum(MainAccount));

oReportManager .createBalanceListTmp (queryrun,

info(strfmt("%1 – %2", DimensionAttributeValueCombination::find(tLedgerTrans.LedgerDimension).DisplayValue, tLedgerTrans.LedgerDimension));