* Put date from combobox into MM/DD/YYYY format for date range on report. *lcFromDate = THISFORM.cboFromMo.Value + "/" + ; * THISFORM.cboFromDay.Value + "/" + ; * THISFORM.cboFromYr.Value *lcToDate = THISFORM.cboToMo.Value + "/" + ; * THISFORM.cboToDay.Value + "/" + ; * THISFORM.cboToYr.Value * Convert Date from Date to Char type gcStartDate = CTOD(gcFromDate) gcEndDate = CTOD(gcToDate) * Convert Date from Date to Char type gcStartDate = CTOD(gcFromDate) gcEndDate = CTOD(gcToDate) IF EMPTY(gcTimeName) gcTimeName = "" ENDIF gcRptDate = gcTimeName + "(" + DTOC(gcStartDate) + " - " + DTOC(gcEndDate) + ")" THISFORM.fromtodate() && Change date in From To Date pull-downs to match chosen date option *** Run Reports *** * Hospital Admissions IF THISFORM.cborpt.Value = "16" THISFORM.HospAdmit() ENDIF * Medical Examiner IF THISFORM.cborpt.Value = "20" THISFORM.MedExam() ENDIF * Monthly Top Shock IF THISFORM.cborpt.Value = "60" THISFORM.crpt.ReportFileName = "c:\annulrpt\motopshock.rpt" * THISFORM.crpt.PrintFileName = "c:\annulrpt\motopshock.doc" THISFORM.crpt.ParameterFields(0) = "ReportYr;"+THISFORM.cboFromYr.Value THISFORM.crpt.ParameterFields(1) = "ReportMo;"+THISFORM.cboFromMo.Value * THISFORM.crpt.Action = 1 testout = THISFORM.crpt.PrintReport ENDIF *!* * Create the CR Object *!* loCR = CREATEOBJECT("CrystalRuntime.Application") *!* * Open the report *!* loCrRpt = loCr.OpenReport("C:\CR\MoTopShock.Rpt") *!* * Set the data location *!* loCRData = loCrRpt.Database *!* loCrTables = loCrData.Tables *!* loCrTables.Item(1).Location = "C:\CR\Customer.DBF" *!* * Set the export options *!* loExportOptions = loCrRpt.ExportOptions *!* loExportOptions.DestinationType = 1 && crEDTDiskFile *!* loExportOptions.FormatType = 29 && crEFTExcel80 *!* loExportOptions.DiskFileName = "C:\CR\Export.XLS" *!* * Export the file *!* loCrRpt.DiscardSavedData() *!* loCrRpt.Export(.F.) *!* * Manual garbage collection *!* loExportOption = NULL *!* loCrTables = NULL *!* loCrData = NULL *!* loCrRpt = NULL *!* loCR = NULL *!* ENDIF * Quarterly Top Shock Award IF THISFORM.cborpt.Value = "51" * THISFORM.MedExam() ENDIF THISFORM.LOCKSCREEN = .T. THISFORM.Refresh THISFORM.setbackcolor THISFORM.LOCKSCREEN = .F. THISFORM.cboRpt.SetFocus()