HMG GridPrint
Grid\/Array data Print interface
HMG GridPrint is an interface to HMG print facility to print the contents of a Grid control or Array along with some additional features.
For the Grid control it can be called by two ways, viz., method and command.
- Method:
<WindowName>.<ControlName>.Print(aHeaders)
- Command:
Grid Data
PRINT GRID <cGridName> ; OF <cParentName> ; [ FONT <cFontName> ] ; [ SIZE <nFontSize> ] ; [ ORIENTATION <cOrientation> ] ; [ HEADERS <aHeaders> ] ; [ SHOWWINDOW ] ; [ MERGEHEADERS <aMergeHeaders> ] ; [ COLUMNSUM <aColumnSum> ] ; [ WIDTHS <aColumnWidths> ] ; [ PAPERSIZE <nPaperSize>] ; [ PAPERWIDTH <nPaperWidth>] ; [ PAPERHEIGHT <nPaperHeight>] ; [ VERTICALLINES ] ; [ HORIZONTALLINES ] ; [ LEFT <nLeft>] ; [ TOP <nTop>] ; [ RIGHT <nRight>] ; [ BOTTOM <nBottom>]
Array Data
PRINT ARRAY <aArrayData> ; [ FONT <cFontName> ] ; [ SIZE <nFontSize> ] ; [ ORIENTATION <cOrientation> ] ; [ HEADERS <aHeaders> ] ; [ SHOWWINDOW ] ; [ MERGEHEADERS <aMergeHeaders> ] ; [ COLUMNSUM <aColumnSum> ] ; [ ARRAYHEADERS <aArrayHeaders>] ; [ ARRAYJUSTIFY <aArrayJustify>] ; [ WIDTHS <aColumnWidths> ] ; [ PAPERSIZE <nPaperSize>] ; [ PAPERWIDTH <nPaperWidth>] ; [ PAPERHEIGHT <nPaperHeight>] ; [ VERTICALLINES ] ; [ HORIZONTALLINES ] ; [ LEFT <nLeft>] ; [ TOP <nTop>] ; [ RIGHT <nRight>] ; [ BOTTOM <nBottom>]
Parameters for these commands:
cGridName: Name of the grid control
cParentName: Name of the parent window of the grid control
cFontName: Name of the font as a character string
nFontSize: Size of the font in points
cOrientation: “P” for Portrait and “L” for Landscape
aHeaders: An array of strings for the custom headers for the report. (Maximum of three headers allowed)
ShowWindow: If omitted, the grid would be printed directly to the printer without showing the
GridPrint features window. Even though 'showwindow' is omitted, if the columns don't fit in
the page width, the GridPrint window will be shown.
aMergeHeaders: To merge two or more columns and have a common header. For using this feature,
a two dimensional array of details of merged headers shall be passed with each
element in the following format,
{{nStartCol1 , nEndCol1 , cMergedHeader1},{nStartCol2 , nEndCol2 , cMergedHeader2},...}
aColumnSum: Page-wise summation of some columns of the grid control can be achieved using this parameter.
A two dimensional array with number of elements equal to the number of columns,
in the following format,
{{lSumReqdCol1,cTransformMask1},{lSumReqdCol2,cTransformMask2},{lSumReqdCol3,cTransformMask3},...}
shall be passed.
aColumnWidths: An array of column widths in mm.
nPaperSize: HMG Paper Description
nPaperWidth: Paper width in mm (only for custom paper size)
nPaperHeight: Paper height in mm (only for custom paper size)
VERTICALLINES: To draw column separator. Default is off.
HORIZONTALLINES: To draw row separator. Default is off.
nLeft: Left Margin in mm
nTop: Top Margin in mm
nRight: Right Margin in mm
nBottom: Bottom Margin in mm
- Sample:
PRINT GRID grid_1; OF form_1; FONT "Arial"; SIZE 12; ORIENTATION "P"; SHOWWINDOW ; HEADERS {"Header1","Header2"} ; MERGEHEADERS mergedheaders ; COLUMNSUM summation ; WIDTHS {0,20,20,20,40} ; PAPERSIZE PRINTER_PAPER_USER ; PAPERWIDTH 200 ; PAPERHEIGHT 200; VERTICALLINES; HORIZONTALLINES; LEFT 15; TOP 15; RIGHT 15; BOTTOM 15
GridPrint Window:
This window has many features to configure the report which are all self explanatory. They are listed here:
Selection of columns to report (You can remove a particular column of the grid in reporting)
The print size of the columns can be altered.
Headers and Footers can be added\/modified.
Page numbers are printed on each page. It can be printed either on top or bottom of the page. Or, if it is not needed that can be removed too.
Font size of the report can be changed.
Column wise, row wise grid lines can be printed\/removed.
Report can be vertically centered to look neatly.
Extra White space between the columns can be spread, so that the report is to fill the width of the paper excluding the margin.
Orientation of the report can be selected.
Printer can be selected from a list.
Standard page sizes or custom page size can be selected, so are the margins.
A blue print preview of the first page is shown before getting printed.
Author:
S. Rathinagiri <[email protected]>