Freigeben über


PrintJobName Property

Shows a user-specified value as the name of the document currently printing in the Windows Print Queue.

Note

The Windows Print Queue is not a dialog box that appears within Visual FoxPro. It is the window that shows documents waiting to be printed, and the status of each document, for a specific printer. You access the Print Queue window by double-clicking the printer for which you want to view document status in Printers and Faxes.

ReportListener.PrintJobName [= cText]

Return Value

Character data type, limited to 255 characters.

Default value is an empty string.

Remarks

Applies To: ReportListener Object.

You can use this property for additional user feedback purposes in derived ReportListener classes. As examples, the ReportListener User Feedback Foundation Class uses PrintJobName in the title of its progress window, and the ReportListener HTML Foundation Class uses PrintJobName in its HTML document title. If you do not assign a value to PrintJobName, both classes default to the report or label filename, similar to the default value Visual FoxPro assigns in the Windows Print Queue for these labels. For more information, see ReportListener Foundation Classes.

Note

When NOPAGEEJECT causes a single print run to occur for multiple reports, the printable page size and other printer-determined characteristics are determined by the first report in the run, because this is the moment at which the print spool is opened. The PrintJobName property is also applied at this time, so only the first value in a chained run of reports is significant to a ReportListener of ListenerType 1 (print mode).

Example

The following example illustrates the availability of multiple PrintJobName properties during a single run of multiple reports chained using NOPAGEEJECT. If you set the ListenerType property for the ReportListener derived class to 1 in this example, the name of the currently-printing document in the Windows Print Queue is My First Report for the entire run. However, when you derive classes from ReportListener and implement other ListenerType values, you can make use of each PrintJobName value during the chained report run.

LOCAL loListener
loListener = CREATEOBJECT("PJN")
loListener.PrintJobName = "My First Report"
REPORT FORM ? NOPAGEEJECT OBJECT loListener
loListener.PrintJobName = "My Second Report"
REPORT FORM ? OBJECT loListener

DEFINE CLASS PJN AS ReportListener

   PROCEDURE BeforeReport()
     MESSAGEBOX(THIS.PrintJobName + ;
       " (runs " + THIS.CommandClauses.File) + ")"
   ENDPROC

ENDDEFINE

See Also

Other Resources

Properties (Visual FoxPro)
Language Reference (Visual FoxPro)