<< # load some data from database /# dbname="/apps/dbcons/produce/MemInfo" # list of fields to include in report /# dblist="record,MemAddress,Contact,COOP,Town,State,Zipcode,Phone,Farmname,mememail,URL,ProdMemIDInfo,Totacreage,RetailMrk" db5_report=DBFINDSORT(dbname,"",1,1000,"Farmname","N",dblist) >> back
<< # calculate some summary data /# # total number of records: dbresults[5,1] /# db5_totalrecords=dbresults[5,1] # total number of allowable records: use getcoleq temp=GETCOLEQ(db5_report,4,"YES") db5_totalallowed=ROWS(temp)/# # total number of categories: use nodups and getcol temp=GETCOL(db5_report,2) temp=NODUPS(temp) db5_totalcats=ROWS(temp)/# DISPLAY "" /DISPLAY # DISPLAY "" /DISPLAY /# #DISPLAY "" /DISPLAY /# >>
Summary Report
Total Members:" + db5_totalrecords + "
Total Viewable:" + db5_totalallowed + "
Unique Member Ids:" + db5_totalcats + "

<<#/#>> << FOR NAME=db5_report ROWNAME=db5_lineitem DO IF db5_lineitem[14] ="0" then #Retail market var set /# db5_.varRetail = "No" Else db5_.varRetail = "Yes" /IF #DISPLAY "" /DISPLAY IF db5_lineitem[4]="0" then DISPLAY "" /DISPLAY ELSE DISPLAY "" /DISPLAY /IF /# #DISPLAY "" /DISPLAY /# DISPLAY ""/DISPLAY DISPLAY "" /DISPLAY If db5_lineitem[13] > "0" then DISPLAY "" /DISPLAY Else DISPLAY "" /DISPLAY /IF DISPLAY "" /DISPLAY /FOR >>
All Members
Data reported below, last updated <>
Farm Info Contact Acreage
NoYes 1700"+db5_lineitem[12]+"Retail Available = "+ db5_.varRetail +"

"+db5_lineitem[9]+"
"+db5_lineitem[2]+"
"+db5_lineitem[5]+", "+db5_lineitem[6]+" "+db5_lineitem[7]+"    
Farm Details
"+db5_lineitem[3]+"
"+db5_lineitem[8]+"
"+db5_lineitem[13]+"n/a
This report was run on   <>