Home › Forums › Development › Adding a collection attribute to Adhoc Report Filter
Tagged: adhoc report filter
- This topic has 4 replies, 2 voices, and was last updated 3 years, 8 months ago by Trevor Ball.
-
AuthorPosts
-
-
March 22, 2021 at 4:42 pm #16505Daniel DonciuParticipant
Hi all,
I added a new localized class CountrySource and a new many-to-many intersection class EntityCountrySource in the model. I want to expose the localized attribute into the “SET CRITERIA FOR FILTERS” popup select. I added a simple attribute as well, and it shows up nicely in this view, under the Contact class, but the collection attribute probably would have to show as another subject area and link? Something like Contact -> EntityCountrySource probably? I added all the new objects to BI Sync and it seems to be working fine as the data is loaded to the BI tables properly, including the BI_1_BIEntityCountrySource table and the BI_1_BITypeLocalization. I tried to add properly to the BI context, I added to the file BI.bicontext, both the collection attribute countrySources in BIContact->BI Attributes, and the new class BIEntityCountrySource with the countrySource attribute of type RBCCountrySourceLocalization (the name of the localization class in base). I also added the BI Class Relationship BIEntityCountrySource->BIContact, but not the reverse. Howver, nothing shows in the select filter criteria popup multi select for the adhoc report.
If it exists, please point me to the detailed instruction document for adding filter attributes to adhoc reports for collection attributes. Otherwise, please indicate what are the steps for adding such attributes to the filter.
0Attachments:
You must be logged in to view attached files. -
March 22, 2021 at 11:30 pm #16514Trevor BallParticipant
Hi Daniel,
It certainly sounds like you’re on the right track, but here’s the documentation I think is most relevant to your situation: https://documentation.nexj.com/pubdev89/nexj-crm-application-development/developing-bi-models
Without looking at your code, my first guess would be that perhaps the attribute is there, but just not quite where you’re looking for it. Keep in mind that filter attributes are ordered by the full association path, so especially with an extra many-to-many class potentially in the association path, is it possible that it’s just higher or lower in the list than you’re currently looking for it?
0 -
March 22, 2021 at 11:37 pm #16521Trevor BallParticipant
Hi Daniel,
Actually, I hadn’t noticed your attachment prior to my previous reply. You say that you added a BIEntityCountrySource->BIContact relationship, but not the reverse, but it seems to me like it is the reverse relationship that you want. You do need to specify both directions; that’s not inferred by the BI context (because in some cases you’ll only want to allow traversal of the relationship in one direction, or at least want it visible to different BI classes). That seems like the first thing I would recommend trying, at least: adding a relationship for BIContact->BIEntityCountrySource.
0 -
March 23, 2021 at 10:24 am #16530Daniel DonciuParticipant
Hi Trevor,
Yes, that is the document I looked at. I am not sure why but it gave me the idea I only need one direction relation.
I made the change suggested – added the reverse relationship. Please see the attachment, I added screenshots to the top of the document. The only change I see is that the child subject area has appeared in the drop down list. However, I do not see anything in the filters multi picker, I would have expected to see it in alphabetical order, but it does not appear anywhere.
I also seeded, every time I make a change to the bi context, I am not sure if it is required but I do it to be sure.
Another thing, I see a section in that document called “Generating a domain from a BI model for Ad Hoc Reports”. I do not have this tool “Run > JasperServer Tool > JasperServer Domain Tool”. Do I need to install anything? However, I do have in the tools menu a tool called “Run > Run Tool -> Generate BI Metadata”. Do I need to run this?
0Attachments:
You must be logged in to view attached files. -
March 24, 2021 at 12:51 pm #16547Trevor BallParticipant
Hi Daniel,
Having looked at that latest attachment, my best guess is that you need to make a change or two to your BI context configuration.
Most notably, I think you need to change the value of the attribute to be the localization instance, rather than the caption (or conceivably alternatively, change the type of the attribute to string, but then it won’t be localized, which I would think is necessary for you). You may need to make corresponding changes to your BI sync infrastructure (ETL/transformation) as well. You’ll want to make sure you have a proper where clause on that attribute in the BI_1_BI class as well; I don’t think I can see that from your attachment.
In short, I would recommend looking at other similar attributes that are working, such as EntityType in the BIContact or BIHousehold classes, and following those examples as closely as possible.
Another thing I think might be helpful with your troubleshooting is adding that child subject area and seeing whether you can add that attribute. My guess right now is that it wouldn’t work there either, so if you can get it working in one spot, the other should probably follow.
To answer your other questions, yes it is necessary to reseed each time you make a change to the BI context, and the JasperServer tool is not relevant to your situation. (Some clients use JasperServer for the Ad Hoc Reports UI, but that doesn’t apply to you.)
0
-
-
AuthorPosts
- You must be logged in to reply to this topic.