Jump to content

Determine number of subsummary occurences


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

Recommended Posts

Posted

Is there a way to programmatically determine the number of subsummary occurences in list view/browse mode.

I have a function that calculates the minimum height of a window (based simply on the layout size and the foundcount). I would like to include subsummaries on this window now in FM10, but I cannot do so without knowing how this will affect the window height.

If there’s an easy way to determine the number of times the subsummary will occur given the foundset, then I should be able to factor that into the window height function.

Posted

Sub-summaries only appear once per unique value in whichever field the found set is sorted by.

So you could create a script that does something like this:


go to record (first)

loop

   if fieldYouAreSortingBy ≠ $lastFieldContents

      set variable $summaryOccurrences to $summaryOccurrences + 1

   end if

   set variable $lastFieldContents to fieldYouAreSortingBy

   go to record (next, exit after last)

end loop

show custom dialog $summaryOccurrences

Then use $summaryOccurrences in your window height calculation.

Hope that helps.

James

Posted

It can be calculated - see:

http://fmforums.com/forum/showpost.php?post/297916/

If you prefer a scripted count, I suggest you study the Fast Summaries technique by Mikhail Edoshin:

http://www.kevinfrank.com/demo-files-78.html

http://edoshin.skeletonkey.com/2006/12/crosstab_report.html

This topic is 5603 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.