Jump to content
Salesforce and other SMB Solutions are coming soon. ×

techic re: listing a report & my first of scripting experience


mastar
 Share

Recommended Posts

Here it goes..

 

 

TIA for you help

 

 

Please bear with me, I am a newbie to FileMaker ver 8.5 for that matter.. I am dwelling into an application that’s mostly working.. we are trying to put some needed finishing touches. The other programmer is limited to his ability too, so why i am getting involve, myself having more experienced with DOS dBase programming. This MESSAGE file might have many records, many of which might have the same account# and index field

 

 

This script acts on the MESSAGE FILE that is sorted by ACCOUNT#

I trying to print/view 3 fields type='summary', representing totals + the ACCOUNT# and the account Name using a Layout

 

This is my first ever script attempt to print out summary totals for each account#

The script below however is more conceptual than good coding not knowing exactly what I am doing, of which I am trying to work out my bugs, also my first learning process and would appreciate any or suggestions

 

 

SCRIPT

=======

 

show All Records

Go to Record/Request/Page[ First ] // goto top of file

Freeze Window

 

Set Variable [ $acctnum; Value: MESSAGE::ACCOUNT# ] // create var is local to the script

 

Loop // 1st loop through all records

 

 

Loop // 2nd loop

 

If [var called acctnum = the sameas MESSAGE::ACCOUNT# ]

//then increment record -and exit this loop returning to first loop and test next record if acctnum = MESSAGE::ACCOUNT#

Else

Exit /// 2nd loop

End If

 

End Loop

 

Go to Layout [ “TOTAL” (MESSAGE) ] //this layout displays only that 1 account# , then the next account etc…

 

Set Variable [ $acctnum; Value: MESSAGE::ACCOUNT# ] // this now stores var acctnum again and compares account# again for the next test

 

Go to Record/Request/Page[ Next; Exit after last ] // skip to next record or until eof()

 

End Loop

 

 

Enter Preview Mode[ Pause ]

Go to Layout [ original layout ]

Link to comment
Share on other sites

Your stated goal is to print out the totals and the account# and name....of what, one account? Of every account?

 

I can't make heads nor tails of the script you were trying to write. Can't tell what it is trying to do. In particular, don't understand what you intended to happen in the loops, and what you wanted to happen when $acctnum matches Message::Account (or when it doesn't, for that matter).

 

Here's a script that may do the kind of thing you had in mind, but since I'm not at all clear on what you want, don't expect to just be able to drop this into place and have it work for you:

 

Comment ["assume you start out on a table of ACCOUNTS"]

Comment ["assume you want to print out information on the current found set of accounts"]

Comment ["you would do a Find beforehand to bring up the accounts you want to be in the report"]

Go to Related Record [show only related records, all records in current found set, using layout "Report Screen" (Message table)]

Sort [Message::Account#, ascending, no dialog]

Enter Preview Mode []

Allow User Abort [Off]

Print Setup [Restore, no dialog, ]

Refresh Window

Pause [indefinitely]

Print [records being browsed, restore]

Enter Browse Mode []

Go to Layout [original layout]

 

The report layout would be a subsummary layout. It would have a subsummary part defined in Layout Mode as subsummary when sorted by Message::Account#. It would contain summary fields that would be defined as the total of — you didn't provide that information but you said you wanted to print totals. Balance Due? Purchase Order Total? whatever.

 

It would also contain, in the same subsummary part, the Account Name and the Account# fields themselves.

 

Then if you also wanted the individual data from the Message records, that would go in the Body part. If you don't — if you only want the totals — don't bother putting in a body part at all.

 

If you want a grand total at the bottom, add a Trailing Grand Summary and put the same summary field(s) down there.

Link to comment
Share on other sites

Sorry, I have confused you with so much meaningless date and explanations. I suppose I am having more trouble just explaining myself.. w/ the lack of understanding how FM stores this internal stuff.. compared to my dbase file structures that do not have internal components like summary field, etc buried within.

 

I did try to create a 'sub summary part' inside my layout.. doing so, iFM ask me to select a field.. So I select MsgCounts a summary type field.. I then get a window message saying 'Sorry, I can not select a summary field or gobal variable?

 

The file again is MESSAGES, I have define in the structure 3 fields types as summary(running) fields, names called MsgCounts, PatchCounts and OutCallCount.. All I want to print/list or view the Summary Fields with the name field called AccountName. I don't care about GrandTotals right now.. Since the Message file contains many more messeges with the same account name, I have been print/ or list multiple records with the same account name.

Link to comment
Share on other sites

MsgCounts is a summary field? What is the field definition for MsgCounts?

 

FileMaker asked you to "select a field" — it should be asking you several times to select a field, for different purposes (what you sort by, what other fields go on the layout, what subtotals/grand totals fields you want). Which dialog was it that led you to select MsgCounts?

 

(Could it have been sort order, or, to put it differently, could it have been the subsummary category that your report would be split up by? You can't use summary fields for that!)

 

If it's a summary field, it either counts or totals something. What field does it count or total? What is the field definition for THAT field?

Link to comment
Share on other sites

Looking good, we almost have it...

 

One problem still... for instance MsgCount, in account 1 we have 3 messages in count, in account 2 we have MsgCount of 4, in account 3 we have MsgCount of 5,,

 

Whats happening in our print report is account 2 MsgCount= 7 the sum of account 1 and account 2 and in Msgcount for account 3 we have a count of 12 which is the total or grand total of all account MsgCount... its summing the MsgCount rather than what should be there.

Link to comment
Share on other sites

THANKYOU.. by luck and your insight and great help we did it... last quest answered was to change the DEFINE dba to "Reset summary field before each account"

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use