EddyB Posted May 15, 2003 Posted May 15, 2003 Hi all, I have written a set of reports on a database - these are just find requests but quite complex ones - ones which the users are finding hard to write, so I have coded them in as scripts and step by step layouts. What I would like the users to be able to do is to be able to print off a report from the find results but for them to specify which fields appear on the list layout - i.e. Create layouts on the fly - has anyone attempted this before, I'm sure one of you gurus must have done! - please could you tell me how you went about this? I only got as far as allowing them to specify a report heading - just a global field which they can type the heading into - this field appears at the top of the standard report layout. But when it is Multi-user, what would the situation be if Person A and Person B were both running a report at the same time - Person A enters their heading into the global field, but Person B then enters their heading in and they both print - Person B's heading would appear on both reports would it not? Any ideas on a way around this, the only way I thought of is to only allow 1 user at a time to run reports but when up to 200 users could be using this, a user could be waiting 3 days to run their report! Any ideas would be greatly appreciated Many thanks Ed.
Pupiweb Posted May 15, 2003 Posted May 15, 2003 Create 3 global fields, format them with a custom value list listing the possible break fields for the report Then make 3 calc fields like: Case ( global1 = "Name", Name, global1 = "Surname", Surname, Etc ... Sort on the 3 calc fields, and memorize the sort order Send your users to a layout with the global fields, make them choose the sort fields and then run the sort script and send them to a report layout with 3 subsummary sections, one for each calc field Caveats: 1. calc fields will be unstored hence things will be slower than normal 2. calc fields will have a specific result type (i.e. text or number) so you might have problems when trying to sort on different field types Improvements: Using the Get field function the system can be made much more flexible since the calcs will become like Get Field (global1) and you'll have just to format the global fields with a value list made of field names Same caveats will apply though
EddyB Posted May 15, 2003 Author Posted May 15, 2003 Thanks for replying, what would happen if 2 users ran reports at the same time, wouldn't the global fields get all mixed up?
Peter Fenner Posted May 15, 2003 Posted May 15, 2003 This is crucial: Global fields don't change for all users in a multi-user environment - only for the user making the change. When restarting Filemaker the host settings will however apply. This can be a huge advantage (or huge disadvantage if mis-understood). Pete
EddyB Posted May 15, 2003 Author Posted May 15, 2003 Thanks a lot Peter - now I know how I can do it - I just didn't want 1 users report to get mixed up with another users report! Thanks again Ed.
EddyB Posted May 16, 2003 Author Posted May 16, 2003 OK I have 5 Global fields whereby the user chooses the fields for the report layout gRepField1 gRepField2 blah blah blah The user selects the fields for the layout, then on the actual report layout I have Calc Fields as PupiWeb suggested. This works fine, but here's the cruncher! How can I adjust the width of each field dependant on the value in the global fields? i.e If the user selects the first global field to be Surname, the Calc field picks this up and sets the first field on the layout to Surname but then sets the width of this field to say 3.598cm. Is this even possible :? Ed.
SteveB Posted May 17, 2003 Posted May 17, 2003 If you give your users this much flexibility (even if FM supported doing these things), users will eventually get things screwed up. Altho you haven't told us what exactly you've done and how sophisticated your users are, its hard to believe that they need total control over everything on every layout. I think you're better off building a system where the users can easily modify a few options on a bunch of reports. For example, you can make it very easy to change the date ranges (assuming your reports are time-dependent), main titles, sorting on a given field, what calculations are displayed, what summaries are shown, etc. Build in a resonable amount of flexibility, meaningfully name the reports, and put them on a menu. Steve
Peter Fenner Posted May 17, 2003 Posted May 17, 2003 Merge text. This will solve your problem. Insert > Merge Field
Pupiweb Posted May 17, 2003 Posted May 17, 2003 Field content size is NOT a problem Make fields as big as the largest field you might choose and set them to shrink on printing Preferably use merge fields as Peter suggests
EddyB Posted May 17, 2003 Author Posted May 17, 2003 Hi Peter, Someone else mentioned this on a another post but I'm not sure how I would then line up the titles to the relevant columns. Steve, The users need this much flexibility. I have given them lots of options like date ranges and stuff, everytime they enter their criteria it adds it into the final perform find script. But there are that many different reports they could run and that many different layouts with different fields on, I wanted the users to define the fields on the layout. Otherwise I would have to setup about 400 different layouts with the different variations of fields on them - which as you can imagine I really do not want to do! Thanks Ed.
Peter Fenner Posted May 17, 2003 Posted May 17, 2003 Ok, I didn't get the gist of your question at first. Hmmm. I can't see how you can offer so much freedom to users (although, what about using the tables layout - which I loathe and have no experience with) This does allow resizing of headers much like spreadsheet row and column headers. The only other suggestion I can make is to limit the users complete freedom to a degree. Allow users only certain entries in gField1. Certain entries in gField2, etc. In your various report layouts use only 3 field sizes - small, medium, large. You could create layouts that will allow for every possible selection made by users. You would have to ascertain all the possible scenarios the user may present, and based on this go to the appropriate layout. The idea of limiting the text field to only 3 sizes is to reduce the number of variables and therefore the number of report layouts. With careful planning of the fields allowed for entry in g1, g2, etc. maybe you could find a solution that only needed say, 20 report layouts. Its pretty extraordinary but not beyond the realms of capability. Pete
Recommended Posts
This topic is 7860 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 accountSign in
Already have an account? Sign in here.
Sign In Now