Re: create individual reports for users
ok, i now want to expand to saving the report to the sales persons personnel file.
this is what i have so far
the reports generate individually, great, each report saves to file, however the location of the file is not changing with each adviser, so all reports are saving to the same advisers file.
i thought as the adviser is filtered for each report, so the field value of emp_file_location would also be filtered.
ok, i now want to expand to saving the report to the sales persons personnel file.
this is what i have so far
Code:
'Date Created: 02-Mar-2011 09:51:31 PM 'Last Updated: 02-Mar-2011 09:54:41 PM 'Created By : richard harris 'Updated By : richard harris 'create a report for each adviser, save to file and email dim vdoc as c dim varEmpFile as c lst = table.external_record_content_get("tcommmngr","alltrim(adviser)","adviser",".t. .and. unique_key_value()") for each foo in lst filter1 = "tcommmngr->adviser = " + quote(foo.value) filter2 = "Tprods->Prod_Commrec=.T..AND.Adv_Paid=.t. .and. adv_paid_date = date()" varEmpFile = alltrim(tstaff->emp_file_location) current_filter = "("+filter1 +") .and. ("+filter2 +")" current_order = current_order_expn() query.filter = current_filter query.order = current_order if A5_GET_RECORDS_IN_QUERY("tcommstat.set",current_filter) > 0 :Report.preview("Comm_Statement",query.filter,query.order) vdoc=varEmpFile+"\\"+"Commission Statement"+" "+dtoc(date(),"1-")+".pdf" :Report.SaveAs("comm_statement","PDF",query.filter,query.order,vdoc,.F.) else 'do nothing end if next
i thought as the adviser is filtered for each report, so the field value of emp_file_location would also be filtered.
Comment