Jump to content
Server Maintenance This Week. ×

Custom Sorting


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

Recommended Posts

Hi

I'm working on a FM9 DB (Mac and PC) that generates a number of different reports using multiple sub-summaries. My client wants to be able to turn parts of the report off (disabling sub-summaries from the sort) without using the built in FM sort dialogue (ie they want a layout with checkboxes for enabling / disabling different parts of the report). Is this possible?

Secondly, they want empty sub-summaries to be removed from the report automatically (ie if a report runs and a sub-summary part is empty, then it should be left off all together, so excluded from the sort).

Any help would be appreciated ;) )

Link to comment
Share on other sites

You'll have to script it. Perhaps there are only a few valid sub-summary combinations. You could have a script that stores the sort order for each combination.

I don't understand the empty sub-sum part of your question. Perhaps you could elaborate.

Have you seen this demo from Ray Cologon? One Layout, Many Reports

Link to comment
Share on other sites

Hi Bcooney

Thanks for your suggestion - unfortunately they are many possible sub-summary combinations and I'm really trying to avoid a massive nested IF / CASE situation.

Thanks for the heads'up on the Dynamic Layout Technique - I'll see if it can help.

As for the empty sub-summary situation, what I meant was that if a report results with a sub-summary containing no data, I would want to turn that sub-summary off automatically. Each sub-summary has a title and I'm trying to avoid spurious titles / blank space when a sub-summary contains nothing.

It is for this reason that I haven't been able to go down the other route, that of generating many report, exporting each as a PDF and then appending each PDF, thus creating a single PDF. Using this system results in lots of blank space, which my client is less than happy about.

Any other suggestions from anyone?

Link to comment
Share on other sites

Yes, I came up with something similar but there are more than just titles, which is why I wanted to disable the sub-summary if it was blank (I felt that if I - or someone else - could come up with a neat way of disabling parts of the sort, then it wouldn't be difficult to use the same technique to remove the blank sub-summaries.

Link to comment
Share on other sites

Quite - however as explained, there is a title (not to mention boxes and lines) in the layout within the sub-summary. These are being printed regardless of whether the sub-summary contains records or not.

If I can put the "automatic disabling of a sub-summary from a sort when it is empty" to one side, my primary concern is creating a report which allows a user to enable / disable fields within the sort without using the 'sort dialogue' built into FM. If I can do that, then disabling blank sections can be accomplished as well. Thanks ;) )

Link to comment
Share on other sites

there is a title (not to mention boxes and lines) in the layout within the sub-summary. These are being printed regardless of whether the sub-summary contains records or not.

I don't think so. However, if there is a sub-summary part, and the records are sorted by its breakfield, there will be at least one instance of the sub-summary in the final report (provided there is at least one record in the found set).

To answer your real question: I don't know of a good way to let users sort their records without giving them access to the sort dialog. Perhaps they could use table view for this, before they move to the print layout. Another workaround is to use unsorted calculation fields for the sort - but this requires handling different data types and is too slow to be practical with more than a handful of records.

IMHO, it's best to provide a fixed number of scripted options.

Link to comment
Share on other sites

That's as I feared, and the only viable option I could think of. Not being able to script custom sorts easily is irritating and, considering what else is available in FM, feels like a missing feature.

Many thanks for all your help - now I'll have to browbeat my client into accepting the solution : )

Link to comment
Share on other sites

The idea of sort step where you could dynamically set the fields and sort options sounds appealling...but man, difficult to implement.

I could see the Specify dialog being one complicated mess of If/Case statements. Fascinating, but it makes me wonder (at least initially) if it is just easier to use a calc field based on a field's value or a global value. Then sort based on the calc field.

Link to comment
Share on other sites

If you mean that the sort fields could be specified by a calculation (á la Set Field By Name) - OK, I can see how that would be useful. But I don't think FMI could implement that easily, esp. since the number of fields in the sort order is not constant.

I would be happy with just restricting the fields users can select in the sort order. Being able to relabel the fields (e.g. 'Show field comments instead of field names') would be a special bonus.

Link to comment
Share on other sites

I would be happy with just restricting the fields users can select in the sort order. Being able to relabel the fields (e.g. 'Show field comments instead of field names') would be a special bonus.

Yes most helpful as they should allow in exports as well. If one could export or sort by either the field label or comment as you had stated then it would help so much for end users. Many times I am reluctant to give this directly to end users since they have no clue what my field names mean.

Sometimes I will have to use a "translation file" with calculations with the names that they want to see, referencing the data file; only because they want an export to Excel the way they want to see it.

Now give me that ability in conjunction with what Michael said earlier regarding a list of fields to select from that I pre-designate and I would be more than happy to open up FULLY exporting to my end users.

Link to comment
Share on other sites

Well you can tell where I stand on the issue : )

A number of the sub-summaries in my report are based on fields within the layout table itself - not on related tables. Consequently, even if the field itself is empty, the record isn't - so the SS is going to display.

I have to use sliding / shrinking to hide those blank fields but of course, you still get the white space between the fields showing up on the report. Thus, when running a report on a record with a number of empty fields that are associated with the sub-summaries, you get blocks of large, combined white space

I'm thinking that the only way to rid myself of this is to use calculated fields instead of the white space between the sub-summaries / fields / titles and shrink them as well.

Crazy.

Link to comment
Share on other sites

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