Jump to content

Best way to include single related record in report?


Tom R.

This topic is 3783 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

 

I'm trying to design a report that shows the current status of our projects. The database has a table for Projects, and a separate table for Status updates, where Projects and Status updates are related one to many. On my report, I want to show the Project details as well as the most recently dated status record related to the project. I tried using a portal on my report, set to sort by date in decreasing order and showing only 1 portal row; but I wanted to use Shrink to Fit, which doesn't seem to work on portals. 

 

I suppose I could have a separate field in Projects for the latest status, and then populate it using a script when running the report; but I was hoping for something a little less involved. 

 

Any advice is appreciated.

 

Thanks!

 

Tom

Link to comment
Share on other sites

You could create a sorted relationship. This would let you put the related fields directly on the layout, no portal required.

 

Portals do slide up though. Not sure what you mean by "shrink to fit."

Link to comment
Share on other sites

I would be inclined to use Last() to access the last related record's information instead.  It would be evaluated on the server thus very fast whereas sorting a relationship will require that all related records be downloaded from the server.   Sorting is a heavy hit so it is worth avoiding when possible.

Edited by LaRetta
Link to comment
Share on other sites

Good point, that would be worth testing. Although in this case I'd imagine it not likely to be noticeable unless viewing a large list.

Link to comment
Share on other sites

This topic is 3783 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.