ListPrinter Interface
TCustomListPrint = class(TScrollBox)
All properties and methods are protrected within TCustomListPrinter.
The following table shows those properties and
methods which are published winthin the sub-modules:
DBG : DBGridPrinter
SLG : StringListPrinter
LV : ListViewPrinter
RE : RichEditPrinter
MM : MemoPrinter
TXT : TextReportPrinter
Published in Module |
||||||
Protected Properties |
DBG |
SLG |
LV |
RE |
MM |
TXT |
property AbortOnCancel: Boolean; | X |
x | x | x | x | x |
property Align; | X |
x | x | x | x | x |
property Alignment: Talignment; | X |
x | x | x | ||
property Color; | X |
x | x | x | x | x |
property Collate: Boolean; | X |
x | x | x | x | x |
property Copies: Integer; | X |
x | x | x | x | x |
property DefaultColWidth: Extended; | X |
x | x | x | ||
property Header: String; | ||||||
property HeaderFormat; | X |
x | x | x | x | x |
property FitPrintToPage: Boolean; | X |
x | x | |||
property Footer: String; | x | x | x | x | x | x |
property FooterFormat: String; | x | x | x | x | x | x |
property FriendlyFooter: String; | x | x | x | x | x | x |
property FriendlyHeader: String; | x | x | x | x | x | x |
property GradientBackground: Boolean; | X |
x | x | x | x | x |
property Lines: TStrings; | X |
x | x | x | ||
property MarginBottom: Extended; | X |
x | x | x | x | x |
property MarginLeft: Extended; | X |
x | x | x | x | x |
property MarginRight: Extended; | X |
x | x | x | x | x |
property MarginTop: Extended; | X |
x | x | x | x | x |
property MeasureUnit: TMeasureUnit; | X |
x | x | x | x | x |
property DragCursor; | X |
x | x | x | x | x |
property DragMode; | X |
x | x | x | x | x |
property Enabled; | X |
x | x | x | x | x |
property FooterFont: TFont; | X |
x | x | x | x | x |
property HeaderFont: TFont; | X |
x | x | x | x | x |
property HeaderText: String; | X |
x | x | x | x | x |
property FooterText: String; | X |
x | x | x | x | x |
property LineSpacing: TLineSpacing; | X |
x | x | x | ||
property OnNewLine: TNotifyEvent; | X |
x | x | x | x | x |
property OnNewPage: TNotifyEvent; | X |
x | x | x | x | x |
property OnGetCellFormat: TGetCellFormatEvent; | X |
x | x | x | ||
property Orientation: TPrinterOrientation; | X |
x | x | x | x | x |
property OnStartDrag; | X |
x | x | x | x | x |
property PageBorders: TPageBorders; | X |
x | x | x | x | x |
property PageBorderOffset: Extended; | X |
x | x | x | x | x |
property ParentColor; | X |
x | x | x | x | x |
property ParentFont; | X |
x | x | x | x | x |
property PrintWYSIWYG: Boolean; | X |
x | x | x | ||
property PrintTitle: String; | X |
x | x | x | x | x |
property PrintToFile: Boolean; | X |
x | x | x | ||
property ProgressMessage: String; | X |
x | x | x | x | x |
property RegistryKey: String; | X |
x | x | x | x | x |
property ShadowColor: TColor; | X |
x | x | x | x | x |
property ShadowOffset: TPixels; | X |
x | x | x | x | x |
property ShowHint; | X |
x | x | x | x | x |
property ShowCancel: Boolean; | X |
x | x | x | x | x |
property ShowProgress: Boolean; | X |
x | x | x | x | x |
property ShowMargins: Boolean; | X |
x | x | x | x | x |
property TableGrid: Boolean; | X |
x | x | x | ||
property TabSize: Integer; | X |
x | x | x | x | |
property TableFormat: String; | X |
x | x | x | x | |
property WordWrap: Boolean; | X |
x | x | x | x | |
property UseRegistry: Boolean; | X |
x | x | x | x | x |
property Visible; | X |
x | x | x | x | x |
property ZoomLocation: TZoomLocation; | X |
x | x | x | x | x |
property ZoomPercent: Integer; | X |
x | x | x | x | x |
Public Functions and Procedures |
||||||
ColType: Integer; (constant) | X |
x | x | x | ||
procedure ActPreparePreview; | X |
x | x | x | x | x |
procedure ActRunPrintout; | X |
x | x | x | x | x |
procedure ActSetPageLayout; | X |
x | x | x | x | x |
property LineNumber: Integer; | x | |||||
property PageCount: Integer; | X |
x | x | x | x | x |
property PageNumber: Integer; | X |
x | x | x | x | x |
property Printing: Boolean; | X |
x | x | x | x | x |
property PrintToPage: Integer; | X |
x | x | x | x | x |
property WSFileName: String; | X |
x | x | x | ||
Function NewLine: Integer; Function PrevLine: Boolean; | X |
x | x | x | ||
Function NewPage: Integer; | X |
x | x | x | ||
Function Print: Boolean; | ||||||
procedure BeginDoc; | X |
x | x | x | x | x |
procedure BeginUpdate; | X |
x | x | x | x | x |
procedure Clear; | X |
x | x | x | x | x |
procedure EndDoc; | X |
x | x | x | x | x |
procedure EndUpdate; | X |
x | x | x | x | x |
procedure RefreshProperties; | X |
x | x | x | x | x |
procedure Write(const Line: String); | x | |||||
procedure WriteLine(const Line: String); | x | |||||
procedure WriteLineAligned(const AAlignment: TAlignment; const Line: String); |
x | |||||
procedure WriteLines(const LinesAsTable: Boolean); | x | |||||
procedure WriteTableLine(const Line: String); | x | |||||
procedure ZoomToFit; | ||||||
procedure ZoomToHeight; | ||||||
procedure ZoomToWidth; |
property AbortOnCancel: Boolean;
Determines what happens when the user cancels printing.
property AbortOnCancel: Boolean default False;
Description
If the user presses the Cancel button while printing and AbortOnCancel is True, then TPrinter.Abort is called. If AbortOnCancel is False, then TPrinter.EndDoc is called.
Back to Top -----------------------------------------------------------
property Alignment: Talignment;
Alignment determines how text is aligned on the page.
property Alignment: TAlignment default taLeftJustify;
Description
Use Alignment to change the way text is printed with WriteLine or WriteLines. Alignment
can be one of the following values:
Value Meaning
taLeftJustify Align text to the left side of the page
taCenter Center text horizontally on the
page.
taRightJustify Align text to the right side of the page.
Back to Top -----------------------------------------------------------
property Collate: Boolean;
Controls whether multiple copies are collated when physically printed.
property Collate: Boolean default True;
Description
If Collate is True and multiple copies are being printed, then pages are printed in the
order: 1,2,3,
,1,2,3,
,1,2,3,.... If Collate is False and multiple copies are
being printed, then pages are printed in the order 1,1,1,...,2,2,2,
,3,3,3,
.
Collate has no effect when only one copy is being printed. Collate also has no effect on
the preview window.
See Also: Copies
Back to Top -----------------------------------------------------------
property Copies: Integer;
Controls how many copies of a document will be physically printed.
property Copies: Cardinal default 1;
Description
Copies has no effect on the preview window.
See Also: Collate
Back to Top -----------------------------------------------------------
property DefaultColWidth: Extended;
Default column width to use when printing table lines.
property DefaultColWidth: TMeasurement;
Description
The column width that will be used if the HeaderFormat, FooterFormat, or TableFormat
contain invalid or missing column widths.
Back to Top -----------------------------------------------------------
property Header: String;
property HeaderText: String;
The text to be printed at the top of each page.
property Header: String;
Description
The Header property is a table string that is laid out as specified by the HeaderFormat
property. For more information see: Table String.
See Also: HeaderFont, FriendlyHeader,
Footer
If specifying a header text in your programs code use HeaterText
Back to Top -----------------------------------------------------------
property HeaderFormat;
The format specifier for the Header property.
property HeaderFormat: String;
Description
HeaderFormat is a table format string that specifies the column widths and alignments to
be used for each field in the Header string. For more information see: Table String.
See Also: HeaderFont, FriendlyHeader,
FooterFormat
Back to Top -----------------------------------------------------------
property FitPrintToPage: Boolean;
Description
If true, the width of all columns will be incresed for a uniform percentage to fit the
printable width of the paper.
Back to Top -----------------------------------------------------------
property Footer: String;
property FooterText: String;
The text to be printed at the bottom of each page.
property Footer: String;
Description
The Footer property is a table string that is laid out as specified by the FooterFormat
property. For more information see: Table String.
Note: There are limitations on the Footer when PrintToFile is True.
See Also: FooterFont, FriendlyFooter,
Header
If specifying a footer text in your programs code use FooterText
Back to Top -----------------------------------------------------------
property FooterFormat: String;
The format specifier for the Footer property.
property FooterFormat: String;
Description
FooterFormat is a table format string that specifies the column widths and alignments to
be used for each field in the Footer string. For more information see: Table String.
See Also: FooterFont, FriendlyFooter,
HeaderFormat
Back to Top -----------------------------------------------------------
property FriendlyFooter: String;
FriendlyFooter is an alternative way to specify both the Footer and FooterFormat
strings.
property FriendlyFooter: String;
Description
FriendlyFooter can contain multiple Friendly Format
Specifiers which control alignment and field content. Setting FriendlyFooter will
automatically rebuild the Footer and FooterFormat
properties. If FriendlyFooter is a non-empty string, then calling BeginDoc also causes the
Footer and FooterFormat properties to be rebuilt.
See Also: FriendlyHeader
Back to Top -----------------------------------------------------------
property FriendlyHeader: String;
FriendlyHeader is an alternative way to specify both the Header and HeaderFormat
strings.
property FriendlyHeader: String;
Description
FriendlyHeader can contain multiple Friendly Format
Specifiers which control alignment and field content. Setting FriendlyHeader will
automatically rebuild the Header and HeaderFormat properties. If FriendlyHeader is a
non-empty string, then calling BeginDoc also causes the Header and HeaderFormat properties
to be rebuilt.
See Also: FriendlyFooter
Back to Top -----------------------------------------------------------
property GradientBackground: Boolean;
Toggles the gradient background effect on and off.
property GradientBackground: Boolean default True;
Description
When GradientBackground is True, the background of the preview window makes a gradient
from Black to the color specified in the Color property. When GradientBackground is False,
the background of the preview window is solid-filled with Color.
Back to Top -----------------------------------------------------------
property Lines: TStrings;
A text buffer to store a list of strings to be printed.
property Lines: TStrings;
Description
The Lines property is typically used to store an existing list of strings (e.g. the lines
from a Memo control) for printing. The WriteLines procedure can then be used to print the
contents of the Lines property with one procedure call.
Back to Top -----------------------------------------------------------
property MarginLeft: Extended;
property MarginRight: Extended;
property MarginTop: Extended;
property MarginBottom: Extended;
The distance from the outer border of the page to stop printing.
property MarginBottom: TMeasurement;
Description
The margins define the printable area used by ListPrinter. Because of their importance to
almost every property and method in ListPrinter, the margins cant be changed while
printing.
See Also: RefreshProperties
Back to Top -----------------------------------------------------------
property MeasureUnit: TMeasureUnit;
Determines whether english or metric units are used for TMeasurement properties.
property MeasureUnit: TMeasureUnit default muInches;
Description
If MeasureUnit is muInches then all TMeasurement properties return their results in
Inches. If MeasureUnit is muMillimeters then all TMeasurement properties return their
results in Millimeters.
MeasureUnit also determines the default paper size. When set to english units, the default
paper size is 8.5 x 11. When set to metric units, the default paper size is
210mm x 297mm (A4).
When switching MeasureUnits, the margins and other TMeasurement properties should
automatically update to display in the selected units. For example, a 1 margin gets
translated to a 25.4mm margin and vice versa.
Back to Top -----------------------------------------------------------
property FooterFont: TFont;
The font used when printing the Footer.
property FooterFont: TFont;
This font should be specified under "Settings"
Description
The FooterFont is only used when printing the Footer text. If you want the FooterFont to
change everytime the Font property changes, set AutoFooterFont to True.
See Also: HeaderFont
Back to Top -----------------------------------------------------------
property HeaderFont: TFont;
The font used when printing the Header.
property HeaderFont: TFont;
This font should be specified under "Settings"
Description
The HeaderFont is only used when printing the Header text. If you want the HeaderFont to
change everytime the Font property changes, set AutoHeaderFont to True.
See Also: FooterFont
Back to Top -----------------------------------------------------------
property LineSpacing: TLineSpacing;
Controls the amount of space between each line when printed.
property LineSpacing: TLineSpacing default lsSingleSpace;
Description
LineSpacing determines how much space is printed between each line of text. LineSpacing
can be one of the following values:
Value
Meaning
lsHalfSpace A half-line width overlapping the previous
line.
lsSingleSpace Immediately after the previous line.
lsSingleAndAHalf A half-line width between it and the previous line.
lsDoubleSpace A full-line width between it and the previous line.
Back to Top -----------------------------------------------------------
property OnNewLine: TNotifyEvent;
An event that fires before each new line.
property OnNewLine: TNotifyEvent;
Description
OnNewLine fires before each new line and at the top of each new page. When it fires at the
top of a new page, it fires after the Header, Footer, and PageBorders are printed.
See Also: OnNewPage
Back to Top -----------------------------------------------------------
property OnNewPage: TNotifyEvent;
An event that fires before each new page.
property OnNewPage: TNotifyEvent;
Description
OnNewLine fires before anything is printed on the page. Thus, you can use it to change the
Header, Footer, and PageBorders before they are printed on each page.
See Also: OnNewLine
Back to Top -----------------------------------------------------------
property OnGetCellFormat: TGetCellFormatEvent;
An event that fires before each new cell of a table will be creted.
property OnGetCellFormat: TNotifyEvent;
TGetCellFormat: TGetCellFormatEvent = procedure(Sender: TObject; const
Col: Integer;
TTableLineColumnInfo = record
Description
See example in TextReportDemo
Back to Top -----------------------------------------------------------
property Orientation: TPrinterOrientation;
Orientation determines if the print job prints vertically or horizontally on a page.
property Orientation: TPrinterOrientation;
Set this option unter "Settings"
Description
Use Orientation to determine if a print job prints in landscape or portrait mode.
Orientation can be one of the following values:
Value Meaning
poPortrait The print job prints vertically on the page.
poLandscape The print job prints horizontally on the page.
Back to Top -----------------------------------------------------------
property PageBorders: TPageBorders;
Determines which edges should have page border lines printed.
property PageBorders: TPageBorders default [];
Set this option unter "Settings"
Description
By default no page borders are printed.
See Also: PageBorderOffset
Back to Top -----------------------------------------------------------
property PageBorderOffset: Extended;
Determine how far above or below the margins the page border lines are printed.
property PageBorderOffset: TMeasurement;
Description
When PageBorderOffset is 0, the PageBorders are printed exactly on the margins. However,
any text written to the page also begins exactly on the margin, so with no
PageBorderOffset, the text will overlap the page borders by a pixel or two. This tends to
look bad.
By setting PageBorderOffset to a small value of about 1/16 (1.5mm), you can prevent the page borders and the text from overlapping each other.
Back to Top -----------------------------------------------------------
property PrintWYSIWYG: Boolean;
Determine wether the preview and printout copies the alignment and font from the source
device.
property PrintWYSIWYG: Boolean;
Description
Only posiible if the ancestor device allows to set this properties
Back to Top -----------------------------------------------------------
property PrintTitle: String
The title to use when a job is sent to the printer.
property Title: String;
Description
The Title property determines the description that will be displayed for your print job
when it is physically sent to the printer. It also determines the caption that is
displayed on the print progress dialog (if ShowProgress is True). Internally,
ListPrinter.Title gets and sets TPrinter.Title.
Back to Top -----------------------------------------------------------
property PrintToFile: Boolean;
Determines whether all text printing goes to a file.
property PrintToFile: Boolean default False;
Description
When PrintToFile is True all text is output to the file specified in the WSFileName
property. When PrintToFile is False all text is output to the print Canvas.
When PrintToFile is True, ListPrinter behaves as if each page were infinitely long. One
implication of this is that if you want page breaks in the output file, you must manually
call NewPage. Another implication is that the Footer doesnt get printed at the
bottom of the page. The Footer is printed at the top of the page directly under the
Header.
Back to Top -----------------------------------------------------------
property ProgressMessage: String;
The status message to display on the print progress dialog.
property ProgressMessage: String;
Description
Lets you specify the status message the user will see in the progress dialog when
physically printing pages. If ProgressMessage is an empty string, then the text of the
SendingPagesMsg constant is used as the status string.
If ShowProgress is False, ProgressMessage is unused.
Back to Top -----------------------------------------------------------
property RegistryKey: String;
When UseRegistry is set to true, the key for safing the
"Settings" values below "HKEY_CURRENT_USER/Software..." is set
by default to "CoSyDat/ListPrint". Set this key for your application to your
needs.
See also: UseRegistry
Back to Top -----------------------------------------------------------
property ShadowColor: TColor;
Determines the shadow color for the preview page.
property ShadowColor: TColor default clBtnShadow;
Description
The color used to draw the shadow effect in the preview window. ShadowColor has no effect
on physically printed output.
See Also: ShadowOffset
Back to Top -----------------------------------------------------------
property ShadowOffset: TPixels;
Determines how large the shadow should be.
property ShadowOffset: TPixels default 5;
Description
ShadowOffset determines how many pixels to the right and bottom of the preview page the
shadow effect should extend to. By setting ShadowOffset to 0, you can disable the painting
of any shadow. ShadowOffset has no effect on physically printed output.
See Also: ShadowColor
Back to Top -----------------------------------------------------------
property ShowCancel: Boolean;
Determines whether the progress dialog has a Cancel button.
property ShowCancel: Boolean default True;
Description
ShowCancel has no effect if ShowProgress is False. If ShowProgress is True and ShowCancel
is True, then progress dialog has a Cancel button that can be used to cancel printing to
the printer. If ShowCancel is False the progress dialog has no Cancel button.
Note: If ShowCancel is True and ShowProgress is True, then the Print function will call
Application.ProcessMessages before printing each page to determine if the Cancel button
has been pressed. ProcessMessages is not called if either of these properties are False.
Back to Top -----------------------------------------------------------
property ShowProgress: Boolean;
Determines whether a progress dialog is shown while physically printing.
property ShowProgress: Boolean default True;
Description
If ShowProgress is True, a progress dialog is displayed while pages are being sent to the
printer. That is, a progress dialog is displayed during a call to Print.
Note: Regardless of the ShowProgress setting, no progress dialog is displayed while pages
are being buffered in ListPrinter (i.e. between BeginDoc and EndDoc). ListPrinter has no
way of knowing how many pages you are going to send to it, so it cant display a
progress indicator before EndDoc is called. If you need a progress dialog during this
phase of printing, you need to create one specific to your application. Display your
custom dialog before calling BeginDoc, update it while sending data to ListPrinter, and
then close it after the call to EndDoc or Print.
See Also: ProgressMessage, ShowCancel
Back to Top -----------------------------------------------------------
property ShowMargins: Boolean;
Determines whether the margins are shown in the preview window.
property ShowMargins: Boolean default True;
Description
If ShowMargins is True, a dashed gray rectangle is drawn on the preview page where the
margins would be. ShowMargins has no effect on physically printed output.
See Also: MarginBottom, MarginLeft, MarginRight, MarginTop
Back to Top -----------------------------------------------------------
property TableGrid: Boolean;
Determines whether grid lines are printed on table lines.
Back to Top -----------------------------------------------------------
property TabSize: Integer;
Determines the width of a tab character in spaces.
property TabSize: Cardinal default 8;
Description
Before tab characters are printed they must be expanded into spaces. TabSize controls how
many spaces are substituted for each tab character.
Back to Top -----------------------------------------------------------
property TableFormat: String;
Determines the layout of columns in table lines.
property TableFormat: String;
Description
Table Format is a table format string that specifies the column
widths and alignments to be used for each field in lines printed with WriteTableLine. For
more information see: Table String.
See Also: DefaultColWidth
Back to Top -----------------------------------------------------------
property UseRegistry: Boolean;
Determines wether the properties, defined under "Settings" are safed to the registry and read when opening next or not.
See also: RegistryKey
Back to Top -----------------------------------------------------------
property WordWrap: Boolean;
Determines whether long lines wrap when printed.
property WordWrap: Boolean default True;
Description
If WordWrap is True, then lines longer than the page width are wrapped and printed on
multiple lines. If WordWrap is False, then lines longer than the page width are clipped at
the right margin.
When previewing and printing tables, with WordWrap all row heights of the tabel are uniform (the text can be cut), if not each row height can differ due to line break at the individual cell.
Back to Top -----------------------------------------------------------
property ZoomLocation: TZoomLocation;
Determines where the preview window focuses when ZoomPercent is changed.
property ZoomLocation: TZoomLocation default zlTopLeft;
Description
ZoomLocation determines which part of the preview page is focused on when ZoomPercent
changes. ZoomLocation can be one of the following values:
Value Meaning
zlTopLeft The top left corner of the page is zoomed in on.
zlTopCenter The top center of the page is zoomed in on.
zlCenter The center of the page is zoomed in on.
Back to Top -----------------------------------------------------------
property ZoomPercent: Integer;
Determines the scale that the preview page is displayed at.
property ZoomPercent: Cardinal default 35;
Back to Top -----------------------------------------------------------
ColType: Integer;
ColTyp is explained in the TextReportDemo!
Back to Top -----------------------------------------------------------
procedure ActPreparePreview;
Handled within the sub-modules. Must be called to start preview.
See the application examples.
Back to Top -----------------------------------------------------------
procedure ActRunPrintout;
Handled internaly by the ListPrinter-ToolBar for printing after previewing.
Can be calle separately without opening the preview.
See the application examples.
Back to Top -----------------------------------------------------------
procedure ActSetPageLayout;
Handled internaly by the ListPrinter-ToolBar for opening the "Settings" dialog.
Back to Top -----------------------------------------------------------
property LineNumber: Integer;
The number of the last line printed on the current page.
property LineNumber: Cardinal;
Description
Run-time and Read only. LineNumber is 0-based and can be thought of as returning the
number of lines printed on the current page.
See Also: NewLine, PrevLine
Back to Top -----------------------------------------------------------
property PageCount: Integer;
Returns the number of pages in the document.
property PageCount: Cardinal;
Description
Run-time and Read only.
See also: PageNumber, Pages
Back to Top -----------------------------------------------------------
property PageNumber: Integer;
Allows you to get and set the page number of the document.
property PageNumber: Cardinal;
Description
Run-time only. PageNumber is always 0 when there are no pages in the document. When there
are pages, PageNumber begins at 1. By setting PageNumber to a value between 1 and
PageCount, you can control which page is displayed in the preview window. However, you
cant set PageNumber while printing.
Back to Top -----------------------------------------------------------
property Printing: Boolean;
Back to Top -----------------------------------------------------------
property PrintToPage: Integer;
Sets the page to stop printing at.
property PrintToPage: Cardinal default 0;
Description
Run-time only. When PrintToPage is 0, printing stops with the last page in the document.
When PrintToPage is non-zero, it specifies the page to stop printing at when physically
printing. PrintToPage has no effect on the preview window. PrintToPage must be greater
than or equal PrintFromPage.
Back to Top -----------------------------------------------------------
property WSFileName: Stringe;
The name of the file to print to when PrintToFile is True.
property FileName: String;
Description
When PrintToFile is True, all text will be output to the file specified in FileName.
All or part of FileName is printed if the FriendlyHeader or FriendlyFooter properties
contain the Friendly Format Specifiers &f or &F.
Back to Top -----------------------------------------------------------
Function NewLine: Integer;
Creates a new line in the document.
function NewLine: Cardinal;
Description
NewLine will advance the CanvasPosition to a new line. If there is no more room on the
current page, then NewPage is called implicitly.
NewLine returns the current LineNumber.
See Also: OnNewLine
Back to Top -----------------------------------------------------------
Function PrevLine: Boolean;
Moves to the previous line in the document.
function PrevLine: Boolean;
Description
PrevLine tries to move the CanvasPosition to the previous line in the document. If
successful, PrevLine returns True; otherwise, it returns False. PrevLine should only fail
at the top of a page.
Back to Top -----------------------------------------------------------
Function NewPage: Integer;
Creates a new page in the document.
function NewPage: Cardinal;
Description
NewPage will create a new page in the current document. NewPage returns the current
PageNumber.
See Also: OnNewPage
Back to Top -----------------------------------------------------------
Function Print: Boolean;
Sends the current document to the printer.
function Print: Boolean;
Description
Print sends a page list to the current printer. The exact behavior of Print is based upon
several settings: AbortOnCancel, Copies,
Collate, PrintFromPage, PrintToPage, ProgressMessage, ShowCancel, ShowProgress, and PrintTitle.
Print returns False if printing was cancelled; it returns True otherwise. Note that
printing can only be cancelled if ShowCancel is True and ShowProgress is True. If both
ShowCancel and ShowProgress are True, then Print uses Application.ProcessMessages to
determine whether the Cancel button has been pressed.
Back to Top -----------------------------------------------------------
procedure BeginDoc;
Begins a new document for printing.
procedure BeginDoc;
Description
BeginDoc will create a new, blank canvas for printing on. It does not send the print job
to a physical printer though. To do that you must call Print.
See Also: EndDoc
Back to Top -----------------------------------------------------------
procedure BeginUpdate;
Turns of screen repainting for the preview window.
procedure BeginUpdate;
Description
BeginUpdate prevents the screen from being repainted until the EndUpdate method is called.
Use BeginUpdate to prevent screen repaints and to speed processing time while you are
changing multiple properties of a preview.
Back to Top -----------------------------------------------------------
procedure Clear;
Clears any current page list.
procedure Clear;
Description
Clear resets any buffered page list. Use this method to free up memory when you are done
with a printed document (i.e. after you finish previewing it or after you finish
physically printing it).
Back to Top -----------------------------------------------------------
procedure EndDoc;
Finishes printing for a document.
procedure EndDoc;
Description
The EndDoc method ends the current job being sent to ListPrinter. After the application
calls EndDoc, the preview window displays the first page printed.
See Also: BeginDoc
Back to Top -----------------------------------------------------------
procedure EndUpdate;
Re-enables screen repainting.
procedure EndUpdate;
Description
The EndUpdate method re-enables screen repainting that was turned off with the BeginUpdate
method.
Back to Top -----------------------------------------------------------
procedure RefreshProperties;
Refreshes important properties of ListPrinter.
procedure RefreshProperties;
Description
RefreshProperties makes sure margins, headers, footers, linespacing, and other values have
valid values based on the current printer settings. You will typically want to call it
after something external (e.g. a Print Setup dialog) may have changed properties of the
current printer.
Back to Top -----------------------------------------------------------
procedure Write(const Line: String);
Writes a line of text and leaves the position at the end of the line.
procedure Write(const Line: String);
Description
Write prints a line of text and leaves the CanvasPosition at the end of the line. Thus,
subsequent calls to Write will begin printing where the previous line left off.
Write ignores the Alignment property. It always prints left justified relative to the
CanvasPosition.
See Also: WriteLine
Back to Top -----------------------------------------------------------
procedure WriteLine(const Line: String);
Writes a line of text and advances the position to a new line.
procedure WriteLine(const Line: String);
Description
WriteLine prints a line of text and calls NewLine.
See Also: Write
Back to Top -----------------------------------------------------------
procedure WriteLineAligned(const AAlignment: TAlignment; const Line: String);
Writes a line of text with a specific alignment.
procedure WriteLineAligned(const AAlignment: TAlignment; const Line: String);
Description
WriteLineAligned behaves exactly like WriteLine except you can explicitly specify the
alignment to print with instead of having to implicitly use the Alignment property.
Back to Top -----------------------------------------------------------
procedure WriteLines(const LinesAsTable: Boolean);
Writes the contents of the Lines property.
procedure WriteLines(const LinesAsTable: Boolean);
Description
WriteLines prints each line of text in the Lines property. If the LinesAsTable parameter
is false, then the lines are printed with WriteLine. If
LinesAsTable is True, then WriteTableLine
is used to print each line as a table string.
Back to Top -----------------------------------------------------------
procedure WriteTableLine(const Line: String);
Writes a line as a table string.
procedure WriteTableLine(const Line: String);
Description
WriteTableLine prints a formatted line of text as a table string.
See Also: TableFormat
Back to Top -----------------------------------------------------------
procedure ZoomToFit;
Zooms the preview window to fit an entire page.
procedure ZoomToFit;
Description
ZoomToFit will recalculate ZoomPercent to fit an entire page into the preview window.
See Also: ZoomToHeight, ZoomToWidth
Back to Top -----------------------------------------------------------
procedure ZoomToHeight;
Zooms the preview window to fit a pages height.
procedure ZoomToHeight;
Description
ZoomToHeight will recalculate ZoomPercent to fit a pages entire height into the
preview window.
See Also: ZoomToFit, ZoomToWidth
Back to Top -----------------------------------------------------------
procedure ZoomToWidth;
Zooms the preview window to fit a pages width.
procedure ZoomToWidth;
Description
ZoomToWidth will recalculate ZoomPercent to fit a pages entire width into the
preview window.
See Also: ZoomToFit, ZoomToHeight
Back to Top -----------------------------------------------------------
Friendly Format Specifiers
Specifies alignment and content for headers and footers using simple codes.
Alignment
&l Left Align
&c Center Align
&r Right align
&t Short time
Content
&f File name only
&F File name and path
&d Short date
&D Long date
&T Long time
&i Title
&p Page number
&& Ampersand (&)
Back to Top -----------------------------------------------------------
A formatted string which defines a table line.
Examples:
Table Format String: <2.5|^-2.5|>2.5
Text Table String: Title: {$TITLE}|{$DATE} {$TIME}|Page {$PAGE}
Description
There are two types of table strings: table format strings and text table strings.
A table format string is made up of zero or more column tokens. Each column token must
contain an alignment character and a column width. An alignment character is either a
< for left alignment, ^ for center alignment, or
> for right alignment. A column width must be a number. TokenSeparator
"|" determines the character which must be between each distinct column token.
Text table strings are just strings concatenated together separated by TokenSeparators
"|". When a text table string is printed using WriteTableLine, each token in the
text table string is printed in a column whose alignment and width are determined by the
corresponding token in the TableFormat property.
If TableGrid is True then negative column widths can be used to force the grid to be
turned off (i.e. not printed) for a specific column. If WordWrap is True then table
strings will wrap to multiple lines as necessary. You can force a line break in a table
string by embedding a linefeed character (ASCII 10) in a token.
In table strings, there are five logical constants which are expanded. {$LINE} is expanded
to the current line number, {$PAGE} is expanded to the current page number, {$DATE} is
expanded to the current date (using ShortDateFormat), {$TIME} is expanded to the current
time (using LongTimeFormat), and {$TITLE} is expanded to the contents of the Title
property.
See Also: DefaultColWidth
Examples
in TextReportDemo
Back to Top -----------------------------------------------------------