// cCSVWinReport2.pkg //-------------------------------------------------------------------> // cCSVWinReport2.pkg // Modified class to add CSV Output // 9/4/2008 RLW - Add checkbox for outputting the CSV header or not // 9/4/2009 JAC - Used psOutputFullname - filename as keyed by the user. // 9/5/2009 RLW - Resized controls to better fit under VDF-15 //-------------------------------------------------------------------> Use cWinReport2.pkg Use vWin32fh.pkg Register_Object oShowInExcel Class cCSVWinReport2 is a cWinReport2 Procedure Construct_Object Forward Send Construct_Object Property Integer piChannelOut Property String[] psOutputHeaderString Property Boolean pbShowInExcel True Property Boolean pbOutputHeader True End_Procedure //----------------------------------------------------------> // Copied directly from cWinReport2.pkg // Added missing Print_To_File to stop the default sending // of output to the printer //----------------------------------------------------------> Procedure PrintReport Integer eMode Get OutPut_Device_Mode to eMode If ((eMode=PRINT_TO_WINDOW) or (eMode=DEFERRED_PRINT_TO_WINDOW)) Begin Send DFPreview End Else If (eMode=PRINT_TO_PRINTER_NO_DIALOG) Begin Send DFPrintDoc // print, no print job dialog End Else If (eMode=PRINT_TO_FILE) Begin // no print anywhere // Added 08/22/2008 End Else Begin // (eMode=PRINT_TO_PRINTER) Send DFPrint // print with print job dialog End End_Procedure //----------------------------------------------------------> // Report_Footer is printed once on the last page before // Page_Footer // Close the CSV Output file // Call whatever opens a CSV file if checkbox checked //----------------------------------------------------------> Procedure Report_Footer Integer iChO eMode Boolean bChecked String sOutputFileName sOutFolder String sOutputFullname // 09/04/2009 Forward Send Report_Footer Get OutPut_Device_Mode to eMode If (eMode=PRINT_TO_FILE) Begin Get piChannelOut to iChO If (iChO > 0) Begin Close_Output channel iChO Send Seq_Release_Channel iChO End Get psOutputFileName to sOutputFileName Get psOutputFolderName to sOutFolder Get psOutputFullName to sOutputFullname // 09/04/2009 Get pbShowInExcel to bChecked If (bChecked) Begin Send vShellExecute "Open" sOutputFullname "" "" End End End_Procedure End_Class // cCSVWinReport2