VFP9 export file name _ open _ export folder selected export file

TALK OFF the SET
the SET SAFETY OFF && coverage do not ask

CheckKeHu checkJieZhang the AND checkXianShangXia the AND IF
ELSE
MESSAGEBOX ( 'choose to merge at checkout online and offline customer units exported ...', 'tips')
the RETURN
ENDIF

SELECT grid1XaoTiaoJian && must
COUNT ALL FOR selection = '√' the TO xuanShuAll
the IF = 0 && xuanShuAll RECCOUNT () = 0
the MESSAGEBOX ( 'checking to export records ...', 'prompt')
the RETURN
ENDIF

The SELECT;
the TRIM (goods name) as cargo name, TRIM (model) models, specifications,;
COUNT (*) items, SUM (sales number) as the total number of sales,;
SUM (sales price * number of sales) / SUM (sales number) as the average sales unit price,;
the SUM (sales * number average purchase unit price) / SUM (sales number) as the average price of the purchase,;
the SUM (sales purchase monovalent number average *) as the total cost,;
the SUM (receivable) as total receivable, sum (paid-up) as the total paid-up;
the FROM DB / XAO;
the WHERE select = '√';
the ORDER BY goods name, model, specification;
the GROUP BY goods name, model, specification;
the INTO CURSOR tmpXaoHeBingExport

keHuDanWei = UPPER (ALLTRIM (thisform.txt customer unit .Value))
xlsFileName + = keHuDanWei The TTOC (DATETIME (),. 1) + '_ _ combined sales details'
COPY the TO Excel \ & xlsFileName. the EXCEPT purchase the FIELDS average unit price, the total cost TYPE XL5 && FOR selection = '√' FIELDS EXCEPT selected source, this code is
a temporary table sELECT grid1XaoTiaoJian && from the new table to the original

MESSAGEBOX ( 'XLS export success ...', 'tips')
&& Open export folder
*! * OX = CREATEOBJECT ( "WScript.Shell")
*! * Ox.run (. "\ Excel", 1, .f .)

&& investigation after the 2020 VBS / VB aspects of the open folder and select the code be rewritten documentation
obj = CreateObject ( "wscript.shell") && Create Object
obj.run ( "% systemroot% \ explorer.exe / select,. \ Excel \ "+ xlsFileName +" . xls ") && open the folder and select the file specified

Guess you like

Origin www.cnblogs.com/noteTech/p/12624273.html