******************************************************************** * Description.......: SpecialMTD() - initializes MTD Report * Calling Samples...: * Parameter List....: tcTable, tlPDF, tlChooseVersion * Created by........: Nadya Nosonovsky 01/08/2001 11:02:27 AM * Modified by.......: Nadya Nosonovsky 02/11/2002 01:36:41 PM ******************************************************************** lparameter tcTable, tlPDF, tlChooseVersion if empty(m.tcTable) if vartype(oJC)="O" tcTable=oJC.outTable else tcTable="\redp\output\Products\mtd\MTDCT0011Toll" && For tests only endif endif local lnSelect, loMessage, lcMessageCaption, ccAviFile #define icMessageBoxCaption "Preparing MTD Report..." *#define ccAviFile "Printing.avi" lnSelect=select() if !OpenTble(m.tcTable,"WorkTable",,"Situs") return .f. endif select WorkTable private llHidePrinting llHidePrinting=.t. *wait window "Wait while preparing MTD Report..." nowait local lcFileName, llReturn llReturn=.t. if vartype(m.gcTempPath)='C' lcFileName=addbs(m.gcTempPath)+'dummy.pdf' else lcFileName=addbs(sys(2023))+'dummy.pdf' endif if m.tlPDF or (m.tlChooseVersion and ; messagebox("Do you want to produce PDF (Yes) or directly print (No)?",36, ; "What report version?")=6) if CreatePDF(m.lcFileName) lcMessageCaption = 'Printing to PDF' ccAviFile = "DocToPdf2.avi" loMessage = newobject("Animation", "Animation.vcx", "", ; && Now use Daniel's vcx class instead lcMessageCaption, ; icMessageBoxCaption, ; ccAviFile) doevents() report form XPMTDReport to printer noconsole delete file (m.lcFileName) release loMessage if !CreatePDF(m.tcTable) llReturn=.f. use in select("WorkTable") endif else llReturn =.f. use in select("WorkTable") endif else && Printed version lcMessageCaption = 'Printing to temp file' ccAviFile = "Printing.avi" loMessage = newobject("Animation", "Animation.vcx", "", ; && Now use Daniel's vcx class instead lcMessageCaption, ; icMessageBoxCaption, ; ccAviFile) doevents() report form XPMTDReport to file (m.lcFileName) noconsole delete file (m.lcFileName) release loMessage endif *set printer to default if vartype(oJC)="O" and vartype(oJC.StepRecCount)="N" oJC.StepRecCount=reccount("WorkTable") endif wait clear select (m.lnSelect) return m.llReturnDo you have other ideas?