June 1, 200124 yr 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.
June 3, 200124 yr 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
June 4, 200124 yr Author 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.
June 5, 200124 yr 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
June 8, 200124 yr Author 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>
June 8, 200124 yr 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
June 11, 200124 yr Author 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.
June 11, 200124 yr 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
Create an account or sign in to comment