Hi, I'm trying to filter the Customer Statement based on the Financial Dimension. One simple way is to create a view like tihs:
https://www.axazure.com/en/show-dimensions-in-a-form-without-adding-table-fields
Well, I have this view and I want to use it to filter the records returned on the customer statement.
I'm trying to modify the query in the report classes.
One simple way would be if I could add the view to the query and then filter on it, but this does seem possible as the query.addDataSource() method wants a tableID.
Can anyone help?
Thanks
hmm...so I only need it for my toString() get the right output but not for the code to correctly apply the filter to the report...but I wonder why Gunjan could see the SQL output without needing to call toString().
You need to set it if you want to get the right output from toString() and you have several child tables joined to a single parent (e.g. A<-B and A<-C, but not if you have A<-B<-C).
That did the trick.
Do we need to set the fetch mode every time there are multiple tables per level or is this just a matter of display?
Thank You!
I believe that toString() will display the query string correctly if you set FetchMode of child data source to QueryFetchMode::One2One.
Let us know if you are able to get it working in the environment. Hopefully that answers your original question regarding adding a view to a query object :)
The only thing that I know we changed is that we moved all objects from one model into another, I wonder if that had an impact. I think I'll test it in a different environment if I get the same behavior
The code should work fine I think. Not sure why the query is not showing the correct value in the watch window. Did you try running the report to see if the query ranges set for dimensions had any effect on the data?
Yeah..same behavior..
I'm trying that now...
Interestingly, what did work in the createBaseCustTransQuery method was this..
DimensionProvider.addAttributeRangeToQuery(q, qbds.name(), identifierStr(DefaultDimension), DimensionComponent::DimensionAttribute, "Value", "AttributeName");
That's odd.
Could you try the same code in CoC of createCustTransQueryForStatementCust method and see if you see similar behavior?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Andrés Arias as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Sohaib Cheema 756 User Group Leader
André Arnaud de Cal... 629 Super User 2025 Season 2
Martin Dráb 514 Most Valuable Professional