******************************************************************** * Description.......: Hides Printing window * Calling Samples...: * Parameter List....: * Created by........: Cathy Pountney #028660 * Modified by.......: ******************************************************************** if wexist('Printing...') move window 'Printing...' to -1000, -1000 endif wait window nowait "Processing report... Please, wait..." return '' ********************* *!* DECLARE INTEGER GetDesktopWindow IN WIN32API *!* DECLARE INTEGER LockWindowUpdate IN WIN32API INTEGER lnHandle *!* hWin = GetDeskTopWindow() *!* LockWindowUpdate(hWin) *!* *COMPILE 123.prg *!* REPORT FORM x TO PRINT *!* LockWindowUpdate(0)This function could be called from the title of your report.
******************************************************************** * 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, lnResult, llProcessed, ; llReturn llReturn = .t. llProcessed = .f. lnResult = 0 lnSelect=select() if !OpenTble(m.tcTable,"WorkTable",,"Situs") return .f. endif if vartype(oJC)="O" oJC.StepRecCount=reccount("WorkTable") endif && Updated:NN: 07/02/02 - don't run report for no records if reccount("WorkTable")= 0 && No transactions for these towns return .f. endif *!* select WorkTable *!* locate for BlankPage=.t. *!* if found() && Already processed *!* llProcessed = .t. *!* endif *!* if !m.llProcessed *!* #define icMessageBoxCaption "Preparing MTD Report..." *!* private llHidePrinting *!* llHidePrinting=.t. *!* local lcFileName *!* llReturn=.t. *!* if vartype(m.gcTempPath)='C' *!* lcFileName=addbs(m.gcTempPath)+'dummy.pdf' *!* else *!* lcFileName=addbs(sys(2023))+'dummy.pdf' *!* endif *!* endif if m.tlChooseVersion if not 'vfpevent.fll' $ lower(set('library')) set library to vfpEvent.fll additive endif #include foxpro.h lnResult = EventMBox("Do you want to produce PDF or print directly ?", ; MB_YESNOCANCEL + MB_ICONQUESTION + MB_DEFBUTTON2, ; "Which report type?", ; "&PDF", ; "&To Printer", "&Cancel") endif do case case m.tlPDF or (m.tlChooseVersion and m.lnResult = IDYES) *!* if !m.llProcessed *!* 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) *!* set message to m.lcMessageCaption *!* loMessage.show() *!* report form XPMTDReport to printer noconsole *!* delete file (m.lcFileName) *!* release loMessage *!* else *!* llReturn =.f. && Failure *!* endif *!* endif if m.llReturn and !CreatePDF(m.tcTable) llReturn=.f. endif case (m.tlChooseVersion and m.lnResult = IDNO) && Printed version *!* if not m.llProcessed *!* lcMessageCaption = 'Printing to temp file' *!* ccAviFile = "Printing.avi" *!* loMessage = newobject("Animation", "Animation.vcx", "", ; && Now use Daniel's vcx class instead *!* lcMessageCaption, ; *!* icMessageBoxCaption, ; *!* ccAviFile) *!* set message to m.lcMessageCaption *!* loMessage.show() *!* report form XPMTDReport to file (m.lcFileName) noconsole *!* delete file (m.lcFileName) *!* release loMessage *!* endif otherwise llReturn = .f. && User canceled endcase wait clear if !m.llReturn use in select('WorkTable') endif select (m.lnSelect) return m.llReturnSee the commented code. The reason, this code is commented, is that with Cathy and Sergey Berezniker's help I was able to generate this report in one pass instead of original two (where I showed animation)...