lumpocole Posted June 1, 2001 Posted June 1, 2001 I need to display what I thought was a simple search result using CDML...Although I have pieced together a crude solution; how can I display the fields "record" "title" "countoftitle" as individual results while searching through the entire database? eg. Total Found Count: 768 0051 How to Succeed in Business 23 0102 Business Plans 19 etc... thanks.
Garry Claridge Posted June 3, 2001 Posted June 3, 2001 This CDML in the format file will do it: [FMP-CurrentFoundCount] records found.<br> [FMP-Record] [FMP-Field: record] [FMP-Field: title] [FMP-Field: countoftitle]<br> [/FMP-Record] OR Is "countoftitle" a summary count of all of those titles found in the search? If so you may be able to use a Global field to achieve the summary. All the best. Garry
lumpocole Posted June 4, 2001 Author Posted June 4, 2001 thanks for your replies... both inline and fmp-record work except for counting the number of records seperately or each occurance. each attempt i make at either summarizing or totaling the "count" field simply results in displaying "1" count for each record when there are different counts for each title: current code [fmp-inlineaction:-db=emailfriend.fp5,-lay=web,-max=25,-sortfield=record,-sort=descending,-token=fmp-field;title1,-find] [fmp-record] [fmp-field:record][fmp-field:title1] [fmp-field:count]<br> [/fmp-record] [/fmp-inlineaction] what i'm i missing?...thanks.
Garry Claridge Posted June 5, 2001 Posted June 5, 2001 Gregg, Here is some Javascript I use for a similar effect. In this code I am tallying invoice amounts by company. The calling URL looks like this: "http://......:1153/FMP?-db=invoices&-format=inv_list.html&-sortfield=inv_bus_id&-findall" <script> curr_bus_id = "blank" ; inv_tot = 0 ; [FMP-Record] if (inv_tot == 0 ) { curr_bus_id = "[FMP-Field: inv_bus_id]" ; curr_bus_name = "[FMP-Field: inv_bus_name]" ; inv_tot = [FMP-Field: inv_total_inc] ; } else if ("[FMP-Field: inv_bus_id]" == curr_bus_id) { inv_tot += [FMP-Field: inv_total_inc] ; } else { document.write(curr_bus_name + " " + (inv_tot).toString() + "<br>") ; curr_bus_id = "[FMP-Field: inv_bus_id]" ; curr_bus_name = "[FMP-Field: inv_bus_name]" ; inv_tot = [FMP-Field: inv_total_inc] ; } [/FMP-Record] document.write(curr_bus_name + " " + inv_tot + "<br>") ; </script> You should be able to substitute your fields. Hope this helps. Garry
lumpocole Posted June 8, 2001 Author Posted June 8, 2001 thanks for replies...almost have it... i used the java script which does exactly what i had intended from the beginning with one issue: the results seem to display randomly even when i change the find and sort method in the URL...also, some duplicate and they do not list according to any -max settings (or any logical way that i can see)... current code: <script> curr_bus_id = "blank" ; inv_tot = 0 ; [FMP-Record] if (inv_tot == 0 ) { curr_bus_id = "[fmp-field:record]" ; curr_bus_name = "[fmp-field:title1]" ; inv_tot = [fmp-field:count] ; } else if ("[fmp-field:record]" == curr_bus_id) { inv_tot += [fmp-field:count] ; } else { document.write(curr_bus_id + " " + curr_bus_name + " " + (inv_tot).toString() + "<br>") ; curr_bus_id = "[fmp-field:record]" ; curr_bus_name = "[fmp-field:title1]" ; inv_tot = [fmp-field:count] ; } [/FMP-Record] document.write(curr_bus_id + " " + curr_bus_name + " " + inv_tot + "<br>") ; </script> </td> </tr> </table> <font size="2" face="arial, verdana"> [FMP-LINKPREVIOUS] Previous [/FMP-LINKPREVIOUS] [FMP-LINKNEXT] More... [/FMP-LINKNEXT] </font>
Garry Claridge Posted June 8, 2001 Posted June 8, 2001 Try it with -max=all or no max at all. If it works OK that way (except for a long list) the paging is doing something to the ordering of the records. I will try it with -max on my data later today. All the best. Garry
lumpocole Posted June 11, 2001 Author Posted June 11, 2001 hello garry, i tried -max=all and no max and fooled a bit with the sorts with no luck. did you have any success? thanks.
Garry Claridge Posted June 11, 2001 Posted June 11, 2001 Gregg, My database has been sorting fine. Are you doing the sort on the 'record' field? How does the sort look in FM? I can see a problem occuring if a page-break occurs part way through a particular title; i.e. that title will have a summary on one page and then on the next page. I don't have a solution for that yet! If we can fix the sort problem first we can then solve the page break quandary. All the best. Garry
Recommended Posts
This topic is 8634 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