Jump to content
Dimitrios

Get(VisibleSummaryParts)

Recommended Posts

Hello,

I am not sure if this is a tip, or if it is already known.

Anyway it has a practical value for me so I thought I post it.

Sometimes I need to present data in a layout with several sub-summary parts and usually no body parts

I find it good interface, to give the user the ability to click on the only visible sub-summary part and reveal the next part in the hierarchy, and so on...

Thus expanding and collapsing the list by clicking on the headers.

From what I read in the forums the standard technique for this is to have a global variable to store whether part X is expanded or not.

I don't like that method very much so I thought of an alternative.

Layout  Example Structure

Sub-Summary Part1   (based on COUNTRIES::Name)

Sub-Summary Part2   (based on COUNTRIES::CityID)

Sub-Summary Part3   (based on CITIES::SalesmanID)

To the right of the sub-summary part, just off screen we put an instance of the field we are sub-summarizing by. 

For example, inline with sub-summary Part1 we put an instance of the field COUNTRIES::Name and we name the Object as "Part1"

 

Now if the sub-summary part is visible using the following :

GetLayoutObjectAttribute ( "Part1";"source" ) will give us "COUNTRIES::NAME"

or if the sub-summary part is not visible will give us error 102 (Field is missing)

 

By looping with a $counter variable through all sub-summary parts (1....n) 

we can get a list of the visible sub-summary parts (the fields they are based on)

Then we can use this information to sort the records anyway we want to.

 

That's it!

I think it would be nice if someone thought a way to have the list sorted in the way the parts are presented.

Thanks, Dimitrios

Share this post


Link to post
Share on other sites

Good one!

Share this post


Link to post
Share on other sites

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


×

Important Information

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