如果在报告中使用了提示calsue
REPORT FORM xxx to PRINT PROMPT
用户可以在打印报告的地方选择打印机。如何获取该记录的打印机名称?
https://support.microsoft.com/en-us/help/162798/how-to-to-use-the-the-set-printer-printer-to-name-command-command-to-print-to-print-to-print-to-print-p- a- a- a- a--In-Visual-Foxpro
为此显示热getPrinter((。这需要从报告中删除提示条款
如何使用提示条款打印报告的打印机:报告表格xxx打印提示
如果这种可能性,也许有一些sys((函数或其他函数,还是可以在报告打印过程中获取打印机名称?
或该命令应该重新输入不使用提示子句,例如:
cPrinter = getprinter()
set printer to name (cPrinter)
REPORT FORM xxx TO PRINT
insert into logfile (PrinterUsedForPrinting) values (cPrinter)
我建议在运行报告之前使用您的调用getPrinter的解决方案(没有提示子句(。在我使用FOXPRO/VFP的长期经验中,我认为我没有遇到过通过报告表格确定打印机的方法...
这是您可能会发现有用的示例包装函数。在运行报告之前,我通常会调用" PickPrinter"。如果PickPrinter返回一个空字符串,我将中止报告。
FUNCTION PickPrinter
IF APRINTERS(a_printers) < 1
MESSAGEBOX("No printers defined.")
RETURN ""
ELSE
lcPrnChoice = ""
lcPrnChoice = GETPRINTER()
IF EMPTY(lcPrnChoice)
RETURN ""
ELSE
*** Include quotes around the printer name
*** in case there are spaces in the name
lcPrnChoice = "NAME [" + lcPrnChoice + "]"
SET PRINTER TO &lcPrnChoice
RETURN lcPrnChoice
ENDIF
ENDIF
ENDFUNC