How to produce report with multiple entities

This is a methodology question:

I want to produce a report that takes a list of applicants and filters those applicants by a criteria to produce a short list of applicants.  

The application has entities for the applicant details, another for their address details, one more for their employment details and lastly one that contains details of clubs that they are members of.

So, it want a report list of that looks like this:

-------------------------------------------------------------------------------------------------------

Name:  Joe Bloggs

Address:  Address1, Address2, Address3, Town, County, Country, Postcode.

Occupation:  JobDescription

Address:  EmpAddress1, EmpAddress2, etc.

Clubs:  Club1

            Club2

            Club3 etc.

---------------------------------------------------------------------------------------------------------

Name:  John Doe

Address:  Address1, Address2, Address3, Town, County, Country, Postcode.

Occupation:  JobDescription

Address:  EmpAddress1, EmpAddress2, etc.

Clubs:  Club1

            Club2

            Club3 etc.

---------------------------------------------------------------------------------------------------------

etc. etc. till the applicants are all reported.

I am struggling with whether to using Table Records or List Records and how to get the block to repeat itself.  Any thoughts on this would be greatly appreciated.

Regards,

Chris.  In Sunny UK.



Hi Chris,

You should use a List Records that has inside a web block. That Web Block should have an input that receives the information that you want to show. On the webblock just organize the input information as you want.

Regards,

Marcelo

OK, but how do I get it to replicate itself for the next record that is to be displayed?  I can see how to do it for the first record.  It is the next one that is causing me issues.

Or are you saying the I use a list records widget and then place a web block inside that list records widget?

Christopher White wrote:

Or are you saying the I use a list records widget and then place a web block inside that list records widget?

This is correct. 


Resuming:

Create a screen where you have your list and the preparation where you fetch and treat your data (filters and so on).

Create a web-block that receives as input the entities you want to present (applicant, addresses, clubs...). In this block present the data you want in order to match the layout of each list item.

Insert the web-block inside the list of records and set the correct mapping between each element.


If you need additional details check this tutorial: https://www.outsystems.com/learn/lesson/1787/web-blocks/?LearningPathId=0

 


OK, so this is what I have at present:

After creating the web block I have created a preparation to that web block that pulls in the entities for the Applicant and the Applicant Status along with the Address entity, Employment Entity and Clubs Entity. I have filtered that based on a single applicant ID.  I have then added to the web block various containers and expressions which then add the Applicant detail and address detail. along with a Table Records widget to contain the Clubs for the applicant.  (He may be a member of more than one club.  A one to many relationship)

Now my question is.  How do I add the web block to a List Record table and pass the Applicant ID to the web block to produce the details of a single applicant on the page.  It then has to repeat this for the next applicant.  Do I need another preparation in the main report page that produces the full list of applicants that will somehow pass the individual applicant ID to the web block?.  This is the bit that is foxing me currently

Regards,  Chris.

  

Solution

I think I have cracked it.  I have added an input Parameter to the web block that pulls in the List applicant ID and then filters the aggregates within the web block by that input parameter.  It works.

Thank you all for your time in helping me to sort this one out.

Regards,  Chris.

Onwards and upwards!!

Solution

Hi Chris,

With that approach you will have performance problems. basically for each record you are doing a new query to the database. 

The best solution is on the aggregate of the page that uses the web block you should query all the records and send the record to the web block instead of passing just the ID.

Regards,

Marcelo

Not sure quite how to do that.  The web block uses 4 entities to produce its results.  If you could explain a little deeper it would be a help.  I am not sure that I would have performance issues as the maximum number of records I am going to pass is going to be less than 50.

But I am willing to try to do it the correct way if that is what you are recommending.

Regards,  Chris.