Constrain Datagrid to display single object

0
I need to export an object’s attribute values (and some associated values) and the “Export to Excel” on a datagrid works just fine once the list of objects has been “Searched” down to the one of interest. If I already know the object of interest is there any way of passing this to the datagrid so that only the object of interest is displayed rather than the user having to use Search criteria to get to the single object. I can do this by using a Microflow to pass the object to the datagrid but then I can’t export associated values. Thanks
asked
2 answers
5

Hi Ray,

From what I understand from your question you know the object which you want to display in the datagrid before opening the page. Else my reply still would work but would need a few extra steps.

However, you could do this by using an helper entity. Then connect this to the entity which you want to display in the grid. Then before opening the page determine if you want to display all objects or just the one of interest. Put 2 grids on the page, one which displays all objects and one which just displays the ones of interest. Based on this set an attribute on the helper entity to make one of the grids visible.  Then open the page in the context of this helper entity and use an asociation or an xpath in your datagrid source to show only objects of interest. Make sure you have set the asociation of the objects to the helper object before opening the page. Here a simple printscreen of how the xpath version would look like:

answered
1

Ray,

Corne is approach sounds like the easiest, but you can also take a look at the excel exporter module. You will be able to make a template of what you want to export, and be able to use a microflow to retrieve the specific object or objects , and use the export to excel java action to create the excel file. 

here is a link to the module in the app store. 

https://appstore.home.mendix.com/link/app/726/Mendix/Excel-exporter

answered