ocrystalReportCrViewer.PrintReport( .F. , 2 )
*--------------------------------------------------------------------------------------------------- *-- Print the current report. PROCEDURE printreport *--------------------------------------------------------------------------------------------------- LPARAMETERS lGetPrinter, nCopies, lCollated, nStartPage, nStopPage * * lGetPrinter .F. does not prompt for printer information, .T. does * nCopies Number of copies to print - default is 1 * lCollated .T. collates, .F. does not * nStartPage Only included if specified * nStopPage Only included if specified * LOCAL cPrinter cPrinter = '' IF VARTYPE(nCopies) = 'L' nCopies = 1 ENDIF IF VARTYPE(nStopPage) = 'N' AND VARTYPE(nStartPage) = 'L' nStartPage = 1 ENDIF * * Choose a printer if indicated * IF lGetPrinter cPrinter = GETPRINTER() ENDIF WITH THIS IF !EMPTY(cPrinter) .crreport.SelectPrinter('', cPrinter, '') ENDIF .crreport.ReadRecords() DO CASE CASE VARTYPE(nStartPage) = 'N' AND VARTYPE(nStopPage) = 'L' .crreport.PrintOut(lGetPrinter, nCopies, lCollated, nStartPage) CASE VARTYPE(nStartPage) = 'N' AND VARTYPE(nStopPage) = 'N' .crreport.PrintOut(lGetPrinter, nCopies, lCollated, nStartPage, nStopPage) OTHERWISE .crreport.PrintOut(lGetPrinter, nCopies, lCollated) ENDCASE ENDWITH ENDPROCCraig,