AddonSoftware Administration - Appendix A – Report Control Automation Processing
Report Control can be set up for both batch style Jasper documents, such as Statements or Invoices, as well as stand alone DocOut or Jasper reports. The Report Control Documents table must contain an entry for each document subject to Report Control. Depending on the Recipient type specified for the document, one or more Report Control Recipients will be set up for each record in the Report Control Documents table. Details can be found in Appendix B - Batch Processing Control. Valid Recipient Types are Customer, Vendor, or Other. If the Recipient Type for a document is Customer or Vendor, then multiple Report Control Recipient records can be defined, specifying either the Customer or Vendor ID in each record. Recipient Type Other is intended for use in stand alone reports, facilitating email/fax to a single recipient. This document contains code snippets to illustrate how the various report types can be set up for Report Control. Standard Batch Report Control Documents
Traditional (non-batch) reports containing +AUTO_SEND Report Control code
Batch Report Flow Example: AR Invoices
rem --- See if this document is set up in Addon Report Control reportControl!=new ReportControl() reportControl!.setDocExtension("pdf") rpt_ctl$=reportControl!.getReportControl(rptctl_alias$) rpt_ctl$=iff(rpt_ctl$="","NO","YES") rpt_id$=iff(rpt_ctl$="YES",reportControl!.getReportID(),"")
rem --- Use ReportControl object to see if customer wants print, email, or fax add_to_print_report=1 if rpt_ctl$="YES" found=reportControl!.getRecipientInfo(rpt_id$,are05.customer_id$,"") if found if reportControl!.getPrintYN()<>"Y" then add_to_print_report=0 if reportControl!.getEmailYN()="Y" or reportControl!.getFaxYN()="Y" emailFax!.add(rpt_id$) emailFax!.add(are05.customer_id$) emailFax!.add(new_doc_id$) endif endif endif
if emailFax!.size() msg_id$ = "CONF_RPTCTL" gosub disp_message if msg_opt$="Y" for email_fax=0 to emailFax!.size()-1 step 3 reportControl!.addToDocQueue(emailFax!.get(email_fax), : emailFax!.get(email_fax+1),"",emailFax!.get(email_fax+2)) next email_fax endif endif
Traditional DocOut Report Flow Example: AR Aging
rem --- see if this report is set up for report control (email/fax)
rem --- next_overlay$ (and stbl("+AUTO_SEND")) will get set only if this report is defined for automated email/faxing
if Option!<>null() rpt_id$=Option!.getAlias() else rpt_id$=pgm(-2) rpt_id$=rpt_id$(max(pos("/"="/"+rpt_id$,-1),pos("\"="\"+rpt_id$,-1))) rpt_id$=rpt_id$(1,pos("."=rpt_id$+".")-1) rpt_id$=cvs(rpt_id$,4) endif
reportControl!=new ReportControl() reportControl!.setDocExtension("pdf") tmp$=reportControl!.getReportControl(rpt_id$) next_overlay$=iff(tmp$<>"",tmp$,overlay$)
goto std_exit
Register/Recap/Update Report Flow Example: AR Invoice Register
update$=pgmdir$+"aru_invoiceentry.aon" overlay$=update$ if gl$="Y" overlay$=pgmdir$+"glr_recap.aon" next_overlay$=overlay$
rem --- see if this report is set up for report control (email/fax) rem --- next_overlay$ (and stbl("+AUTO_SEND")) will get set only if this report is defined for automated email/faxing
if Option!<>null() rpt_id$=Option!.getAlias() else rpt_id$=pgm(-2) rpt_id$=rpt_id$(max(pos("/"="/"+rpt_id$,-1),pos("\"="\"+rpt_id$,-1))) rpt_id$=rpt_id$(1,pos("."=rpt_id$+".")-1) rpt_id$=cvs(rpt_id$,4) endif
reportControl!=new ReportControl() reportControl!.setDocExtension("pdf") tmp$=reportControl!.getReportControl(rpt_id$) next_overlay$=iff(tmp$<>"",tmp$,overlay$)
goto std_exit
next_overlay: rem --- Run update overlay
if OutVect!<>null() then next_overlay$=update$ rem --- if register was set up for automated email/fax, send recap along as well if reportControl!<>null() and stbl("+AUTO_SEND",err=*endif)<>"" overlay$=update$ next_overlay$=reportControl!.getNextOverlay() endif out_action$="PRT" goto std_exit else dummy$=stbl("+AUTO_SEND","") next_overlay$="" out_action$="" run update$,err=remove_locks_and_exit endif
______________________________________________________________________________________ Copyright BASIS International Ltd. AddonSoftware® and Barista® Application Framework are registered trademarks. |