Link to home
Start Free TrialLog in
Avatar of jossmeele
jossmeeleFlag for United States of America

asked on

FileMaker Report sliding/printing for Portals for many-to-many relationship

I need help to resolve a Sliding/Printing problem in a report:
main tables: Patients with Name-fields, GeneralCondition-field, Allergy-field, and more
related tables: MedicalConditions via a Join-table which contains patient specific info such as date & notes
                       MedicalTests via a Join-table which contains patient specific info such as test-date & notes
I wrote a report that uses the Sliding/Printing function for the Patient text fields such as GeneralConditions, Allergy (can be empty or one or more lines of text) and Portals for the related tables.
The Sliding/Printing works fine for the Patient-fields but I now also need Sliding/Printing for the Notes-fields of the related tables which can also contain one or more lines of text.
Is there anyway to achieve this?
Avatar of Member_2_908359
Member_2_908359
Flag of France image

sliding/shrinking is very tricky. it is difficult to give an advice without seeing the layout, so easy to forget an object... make sure portal are set to shrink... the best method to locate the giulty object is often to duplicate the layout (to keep a backup^) and delete objects untill it works, then place them back one by one, and check the setting of the guilty one.
you should avoid using this feature anyway, very fragile, and build yr reports from the "details" table rather than using the parent table and have portals to display details. this way, using summaries parts in the layout is much easier as shrinking is impled automatically.
if this cannot be used, I often create a field which the concatenation of related sub fields in the parent table and use that for printing.
Avatar of jossmeele

ASKER

thanks lesouef.
The shrinking of the portals works, i.e. it shrinks to contain all the related records and no more.
But the problem is that within each portal I have a "notes" field that can be one or more lines of text. There is no shrinking of the portal-line available as far as I know.
example of what I would like to achieve:
portal-line related record1: date-field condition-name noteline1
                                                                                    noteline2
                                                                                    noteline3
portal-line related record2: date-field condition-name noteline1(there is only one line of note text)
portal-line related record3: date-field condition-name noteline1(there is only one line of note text)

So that brings me to ask how do you then build a report that shows records of all the related tables?
Example of what my report should look like:
Header: Company info & patient name (repeated on each page)
Body:    Further patient fields, made to shrink depending on how much text they contain.
MedicalTests:        zero, one or more lines of medical-test fields relating to the patient
MedicalConditions zero, one or more lines of medical-information fields relating to the patient
Footer: date, page# etc.

A subsummary-part does not help here because I need to report on two related tables that are at the same "level", i.e. level1=patient-table
                           level2=medical-history
                           level2=medical-conditions
Please provide me with an example of how you would build a report using concatenating fields.
thanks, Jos
shrinking a portal line: no you can't for sure.
building a report from 2 sub-tables is also not possible.
so you are left with the concatenation table.
the principle is rather easy:
for  each record (in a loop then)
goto related records
goto 1st record
def a $lines variable = field1 & field2... all the stuff you need & "[return]"
goto next record
def a $lines variable = $lines = field1 & field2... all the stuff you need & "[return]"
etc...
once the loop is over, define a field in the parent table to contain $lines.
this way, yr report does not need sub tables anymore
I tried it with one of the related tables and it works fine!
Few additional questions:
1.my script loops over all patients and for each patient it loops over the related records for each related table, switching from one lay-out to the next. This will be a lengthy process.
Are there any tricks to make this more efficient? I use "Freeze Widno" but thats all I could think off.

2.is there a way to get the concatenation fields (one field in the main table for each related record) to display in neat columns? I currently use: Left(<field>,"<lots of spaces>";<columnwidth>) but I rather use a TAB-character and define columns as can be done in Merge-fields.
I'm almost there!!!
Thanks, Jos.
Additional clarification on item 2:
I mean to say that each concatenation-field in the main record contains (after processing) data from the related tables as: <field1><space><field2><RETURN><field1 next related record><space><field2 next related record><return> etc....
I would like all <field1> text to be in one column, <field2> in the next column.
Can I substitute the <space> characters for TAB (which is I believe numerical 13) and define TABs on the lay-out ruler?
Thanks, Jos.
1
yes, a bit lenghty, freezing won't improve as filemaker now does not refresh screen during scripts very much. no other trick to make faster unfortunately. bare in mind that this is quicker than printing anyway.

2
yes, use tabs in between concatenations. you can type them in the calc window by using 'Ctrl Tab' (or paste one from notepad, simpletext, whatever) since Tab moves the cursor to next window field. then define the tab values for the field in the layout. Better use a <<merge field>> for this particular field, to avoid lines to be cut half way down at the bottom of pages (whihc happens with regular fields)
ASKER CERTIFIED SOLUTION
Avatar of Member_2_908359
Member_2_908359
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many thanks, a pitty there is not an easier solution but this will do fine for me!!
I'm impressed with your fast responses!!
Greetings, Jos.
I am not fast, it's just that I was behind my PC when you raised yr question.
What would be nice is to be able to do this with a variable, but we can't print them.
As far as the shrink feature is concerned, it's a bit like this in all databases apps...
have a good week end.