|
      1) Indirectly with the dBLprintButton object.             a) properties.             b) methods.       2) Directly with the dBLprint object.             a) properties.             b) methods.       Questions on direct use.             a) How is a dBLprint object created ?             b) How is a profile created ?             c) How is it used with a dBASE Report object ?             d) Where is the beef (real world) ?   |
| dBLprintButton Method | ||
| choosePrinter | open a dialog for changing a profile. | |
| print a report using a profile. | ||
| preview | display a report in a form. |
| dBLprintButton Property | Default | ||
| appname | "dBLPrint" | specifies the profile to work with. | |
| margins | false | used to determine whether to show the Margin adjustment area with choosePrinter. | |
| options | true | used to determine whether to show the Options button with choosePrinter. | |
| printer | "" | further specifies the profile to work with. | |
| reportClass | "" | report className to use with preview or print method. | |
| reportFile | "" | file name holding the reportClass property value. | |
| streams | false | used to determine whether to show the Margin adjustment area with choosePrinter. | |
| testClass | "" | report className used by the Test button with choosePrinter. | |
| testFile | "" | file name holding the testClass property value. | |
| viewerClass | "" | form className to use with the preview method. | |
| viewerFile | "" | file name holding the viewerClass property value. |
|
A dBLprint object is created using the profile (from the appname and printer properties). An instance of the report (from the reportClass property) is created using the file (from the reportFile property). The profile is applied to the report printer object. The report is output to printer. The report is destroyed. The dBLprint object is destroyed. User control is returned to the form. |
|
oRef = new dBLprint( [<char> application name, [<char> printer name]]) example: oRef = new dBLprint("Payroll", "Reports") |
| dBLprint Method | ||
| enumPaperSize(<char> printer name) | returns a 2 column array of printer paper sizes. | |
| enumPaperSource(<char> printer name) | returns a 2 column array of printer paper trays. | |
| enumPorts(<array> printer names) | returns a 1 column array of printer ports matching a printer array. | |
| enumPrinters() | returns a 1 column array of printer names. | |
| get(<char> property name) | returns a property value. | |
| getPdriver(<char> printer name) | returns a driver name for use with _pdriver. | |
| getPort(<char> printer name) | returns a port name. | |
| getDefaultPrinter() | returns the windows default printer name. | |
| release() | release object from memory. | |
| set(<char> property, <pVal> value) | set a property value, returns true/false (success/fail). | |
| setDefaultLanguage(<char> language) | set language for dialogs, returns true/false (success/fail). | |
| setDefaultPrinter(<char> printer name) | set the windows default printer, returns true/false (success/fail). | |
| setPrinter(<pRef> printer object) | assigns properties to a printer object, returns true/false (success/fail). | |
| showPrinter([<int> hwnd]) | returns true/false (OK/Cancel). |
|
set procedure to dBLprint.co additive // Note: we are using dBLprint.co instead of dBLprint.cc // for compatibility with all 32 bit versions of dBASE. oRef = new dBLprint("TestApp", "Checks") oRef.showPrinter() // make a couple of selections and then click the OK button. inspect(_app.printer) // notice a few of the property values. oRef.setPrinter(_app.printer) // notice a few of the properties have changed. // You may need to toggle the tabs to refresh the inspector. // close the inspector. inspect(oRef) // the properties and methods of oRef (dBLprint) are displayed. oRef.release() |
| dBLprint Property | Default | ||
| colorNormal | "BtnFace" | colorNormal property of the showPrinter dialog. | |
| margins | false | do margin values get added to pageTemplate1 with setPrinter ? | |
| options | true | does the Options button appear with showPrinter ? | |
| reportClass | "" | report className used by showPrinter Test button. | |
| reportFile | "" | file name holding the reportClass property value. | |
| streams | false | do margin values get added to streamFrame1 with setPrinter ? | |
| text | " Printer Selection" | caption used in the showPrinter dialog. |
|
color <int> 0=Default, 1=Mono, 2=Color/Shades of gray. copies <int> 1 Number of prints to make. duplex <int> 0=Default, 1=None, 2=Duplex vertical, 3=Duplex horizontal. orientation <int> 0=Default, 1=Portrait, 2=Landscape. paperSize <int> Evaluates to a Width x Height paper size. paperSource <int> Evaluates to a paper tray or bin. printerName <char> Name displayed in the windows printer applet. printerSource <int> 0=Windows default, 1=dBASE default, 2=Specific Printer. resolution <int> 0=Default, 1=Draft, 2=Low, 3=Medium, 4=High. trueTypeFonts <int> 0=Default, 1=Bitmap, 2=Download, 3=Substitute, 4=Outline |
|
set procedure to dBLprint.co additive oRef = new dBLprint("Payroll", "Reports") // Assign other properties as desired. // ie: oRef.margins := true oRef.showPrinter() close procedure dBLprint.co |
|
set procedure to dBLprint.co additive oRef = new dBLprint("Payroll", "Checks") // Assign other properties as desired. // ie: oRef.margins := true oRef.showPrinter() close procedure dBLprint.co |
|
// Notes: // The profile must be applied before issuing a report.render(). Local oRef, oRepo set procedure to my.rep additive set procedure to dBLprint.co additive // Create report object. oRepo = new myReport() // Redirect report output to the Printer. oRepo.output := 1 // Either create a dBLprint object with the "Reports" profile. oRef = new dBLprint("Payroll", "Reports") // or create a dBLprint object with the "Checks" profile. oRef = new dBLprint("Payroll", "Checks") // Assign other properties as desired. // ie: oRef.margins := true // Apply the profile to the report's printer. oRepo.printer.parent = oRepo oRef.setPrinter(oRepo.printer) oRepo.printer.parent := null // Run the report. oRepo.render() // Destroy objects. oRef.release() oRef := null oRepo.release() oRepo := null close procedure dBLprint.co close procedure my.rep |