PtrDevice Class
<< Click to Display Table of Contents >> PtrDevice Class |
![]() ![]() ![]() |
Purpose
The purpose of this class is to provide access to the Windows printer facilities in an enhanced fashion.
Properties
Access/Assign Access/Assign Access/Assign Access/Assign Access/Assign Access Access/Assign Access Access Assign Access/Assign Access Access/Assign Assign Access Access Access Access Access/Assign Access/Assign Access Access Access/Assign Access/Assign Access Access Assign
|
Assign Assign Assign Access/Assign Access/Assign Access Access/Assign Access/Assign Access Access/Assign Access/Assign Access Access Access Access Access/Assign Access Access/Assign Access/Assign Access Access/Assign Access/Assign Access/Assign Access/Assign Access Access/Assign Access/Assign |
Methods
Callback Methods
The following methods are automatically called by the PtrDevice object during printing if they exist as methods of the Report object. The Report object is the object which is specified in the second parameter of the PtrDevice:Init().
Description
The PtrDevice class gives you access to the Windows printer system and guides the production of your output in an event driven manor. To use the PtrDevice class, you must instantiate a PtrDevice object, perform desired initialization and call the Print() or PrintPreview() method.
Once you call the Print() or PrintPreview() method, the PtrDevice gathers output for the report by calling the callback methods identified above. The callback methods are invoked only if they exist as part of the Report object (the object passed as the second parameter of the PtrDevice instantiation). The methods (if they exist) are called in the following order:
// called once to allow for initialization
PrintStart()
// called before PreBody
PrintSetPage()
// called once (useful for title page,
// table of contents, etc.)
PrintPreBody()
// loop for each page
// each of the below methods are called
// once for each page
PrintSetPage()
PrintPageHeader()
PrintPageBody()
PrintPageFooter()
// Loop ends when PRINT_NOMORE or
// PRINT_ERROR is returned
// from PrintPageBody()
// called once (useful for
// report totals, footnotes etc.)
PrintPostBody()
// called once to allow for clean up.
PrintEnd()
Example
The PTR_EX sample program is a good example of PtrDevice class usage. Even though the samples use the RpPrinter class, they illustrate the proper use of the callback methods.