This is a good example of the danger of multiples in
FM. They can create
non-normalized databases, forcing folks to stand on
their head to get
some results. It is much easier, when reporting, to
deal with files
that have pointers that link the records. Having
said that, these
pointed files can be a pain in templates for
editing.
Bob Beckley wrote:
Greg,
I finally ended up with this, and it seems to do
the trick when I tie it to
a print-type menu option. I want to report just
instances of where one
sub-field equals another sub-sub-field. Any
additional comments are
certainly welcome.
TST>D Q^DI
VA FileMan 22.0
Select OPTION: PRINT FILE ENTRIES
OUTPUT FROM WHAT FILE: PRINT TEMPLATE// 458 TIME &
ATTENDANCE RECORDS
(281
entries)
SORT BY: PAY PERIOD//
START WITH PAY PERIOD: FIRST// 04-12
GO TO PAY PERIOD: LAST// 04-12
WITHIN PAY PERIOD, SORT BY: 1 EMPLOYEE
(multiple)
EMPLOYEE SUB-FIELD: 10 DAY # (multiple)
DAY # SUB-FIELD: APP. SUPERVISOR=TIMEKEEPER
POSTING
WITHIN APP. SUPERVISOR=TIMEKEEPER POSTING, SORT
BY:
STORE IN 'SORT' TEMPLATE: ZZBBSEARCH1
Are you adding 'ZZBBSEARCH1' as a new SORT
TEMPLATE? No// Y (Yes)
DESCRIPTION:
No existing text
Edit? NO// YES
==[ WRAP ]==[ INSERT ]=============< DESCRIPTION
===========[ <PF1>H=Help ]====
Search template for APP. SUPERVISOR = TIMEKEEPER
POSTING fields in T&A
file.
<=======T=======T=======T=======T=======T=======T=======T=======T=======T>==
====
SHOULD TEMPLATE USER BE ASKED 'FROM'-'TO' RANGE FOR
'PAY PERIOD'? NO// y
YES
FIRST PRINT FIELD: .01 PAY PERIOD
THEN PRINT FIELD: 1 EMPLOYEE (multiple)
THEN PRINT EMPLOYEE SUB-FIELD: 2 APP. SUPERVISOR
THEN PRINT EMPLOYEE SUB-FIELD: 10 DAY #
(multiple)
THEN PRINT DAY # SUB-FIELD: 102 TIMEKEEPER
POSTING
THEN PRINT DAY # SUB-FIELD:
THEN PRINT EMPLOYEE SUB-FIELD:
THEN PRINT FIELD:
Heading: TIME & ATTENDANCE RECORDS LIST Replace
... With T&A Check
Replace
T&A Check
STORE PRINT LOGIC IN TEMPLATE: ZZBBPRINT1
Are you adding 'ZZBBPRINT1' as a new PRINT
TEMPLATE? No// Y (Yes)
START AT PAGE: 1//
DEVICE:
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On
Behalf Of Greg
Kreis
Sent: Saturday, January 29, 2005 4:24 PM
To: [email protected]
Subject: Re: [Hardhats-members] Template Question
Why not create a computed field that figures out if
the condition exists
and then sets its value (S X=...) to what you want
to print? Here is a
general form for the code.
S X="" S:<condition> X=<sub-field retrieval code>_"
"_<sub-sub-field
retrieval code>
In the code for <condition>, <sub-field> and
<sub-sub-field> you can
refer to the variables D1 for the sub-field record
number and D2 for the
sub-sub-field record number.
The above approach means you need to create this
field in the
sub-sub-file so that when it is accessed, the
values of D1 and D2 exist.
But, is that what you want? For instance, aren't
you going to have to
go through all the sub-sub-file records to compare
their field to
sub-field? I am not quite sure I understand a
database situation where
this makes sense. Can you give some more details?
Bob Beckley wrote:
I think I figured it out, all you late risers. :)
Almost . . .
I drilled down to the lower sub-field and entered
a boolean _expression_
(which used both sub-fields), which returns 0 or 1
in X. Then, at the next
prompt, I can work with X. Now I just need to
figure out how to suppress
the printing of the 0's and print only the 1's.
If I mess with the boolean
at all, it doesn't like it (I get ?? back.).
Right now I have
SUB-FIELD=SUB-FIELD for the boolean, and when I
try something like I
(SUB-FIELD=SUB-FIELD)=1 W "MORE INFO", it blows
up. Any ideas. Thanks
again in advance.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On
Behalf Of Bob
Beckley
Sent: Saturday, January 29, 2005 6:22 AM
To: [email protected]
Subject: [Hardhats-members] Template Question
I'm building a print template and want to compare
the values of two
sub-fields in the same file. One sub-field is one
level down in "multiple
A", while the other is two levels down in
"multiple A." If they are the
same, I want to print both fields; if different,
then print nothing. The
problem lies in knowing what to write at the "AND
THEN FIELD:" prompt. If
this were pointer-related instead of
sub-field-related, I would write
something like (A:B=A:C:D) and then do something
with the return value of 0
or 1. I guess what I'm asking is what syntax do I
use to define and
evaluate sub-fields within a print template.
Thanks in advance for any
light you can shed on this.
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW --
Interactive Reporting
Tool for open source databases. Create drag-&-drop
reports. Save time
by over 75%! Publish reports on the web. Export to
DOC, XLS, RTF, etc.
Download a FREE copy at
http://www.intelliview.com/go/osdn_nl
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW --
Interactive Reporting
Tool for open source databases. Create drag-&-drop
reports.