cObject
---Report
------Report_DS
---------BasicReport
------------cWinReport2
The WinReport2 class is a subclass of BasicReport. This provides most of the capabilities of the BasicReport class and provides the ability to use WinPrint2 to provide more-graphical reports (different font styles, font weights, font orientations, graphics, etc.). It does not use images for creating reports. Instead, output is specified with the WinPrint2 command extensions.
To support printing of reports in Windows (proportional) fonts. All reporting functions are supported, including nested reports. Objects of this class support all types of constraints including parent-file, full access to indexes with multi-level subsection totalling, and access to child-file records by parent-file indexes.
pbSmartRelate controls whether DataDictionaries perform relates on parent tables that are not connected to the DDO (DataDictionary Object) structure. By default, this is set to True in the DataDictionary class , meaning that relates on parent tables not in the DDO structure are not performed.
The cWinReport2 wizard in the Studio makes it easy to get started with this class and is a great learning tool. Try generating some reports using this wizard. After the report is generated, load the report and study the code.
The cWinReport2 class uses a number of constants created for use by this class and its subclasses. The constant categories are:
The cWinReport2 class uses a number of commands created for use by this class and its subclasses. Those commands are:
Object oCustomer_WinPrint is a cWinReport2 Set Report_Title to "Printing Customer Names" Set Server to Customer_dd Set Ordering to 1 Function Starting_Main_Report Returns Integer Integer iRetVal Send DFSetLandscape True Send DFSetMetrics WPM_CM Send DFSetmargins 1 1 1 1 Forward Get Starting_Main_Report To iRetVal End_Function Procedure Page_Top string sFont integer iSize iStyle Move "Arial" to sFont Move 8 to iSize Move (font_default) to iStyle DFFont sFont DFFontSize iSize DFBeginHeader DFPageTop DFHeaderPos HDR_Left DFHeaderFrame HDR_NOFRAME DFWriteLn ("Page:" * "#pagecount#") (iStyle+Font_Right) DFEndHeader End_Procedure Procedure Page_Header string sFont integer iSize iStyle iFill iBorder Move "Arial" to sFont Move 16 to iSize Move (font_Bold+rgb_white) to iStyle Move (rgb_dGrey) to iFill Move (rgb_dGrey) to iBorder DFFont sFont DFFontSize iSize DFBeginHeader DFPageHeader DFHeaderFrame HDR_MARGINs 0 iBorder iFill DFHeaderMargin HM_BottomOuter 0.08 DFHEADERPOS HDR_LEFT DFWritelnPos "Customer List " 0.10 (iStyle) DFEndHeader End_Procedure Procedure Page_Title Boolean bOn string sFont integer iSize iStyle iFill iBorder Get pbLandscape to bOn Move "Arial" to sFont Move 8 to iSize Move (font_Bold+rgb_dBlue) to iStyle Move rgb_Grey to iFill Move rgb_Grey to iBorder DFFont sFont DFFontSize iSize DFBeginHeader DFPageTitle DFHeaderFrame HDR_MARGINs 0 iBorder iFill DFHeaderMargin HM_BottomOuter 0.16 DFHEADERMargin HM_TopInner 0.01 DFHEADERMargin HM_BottomInner 0.01 DFHEADERPOS HDR_LEFT DFWritePos "Number" 0.1 (iStyle) DFWritePos "Name" 2 (iStyle) DFWritePos "Address" 7 (iStyle) DFWritePos "City" 12 (iStyle) DFWritePos "State" 15 (iStyle) DFWritePos "Zip" 16 (iStyle) DFWritePos "Comments" 18 (iStyle) DFWriteln DFEndHeader End_Procedure Procedure_Section Body string sFont integer iSize integer iStyle Send Update_Status (String(Customer.Customer_number)) Move "Arial" to sFont Move 8 to iSize Move (font_default) to iStyle DFFont sFont DFFontSize iSize DFLineCheck 5 DFWritePos Customer.Customer_number 0.8 (iStyle+Font_Right) 0 DFWritePos Customer.Name 2 (iStyle) -1 4.08 DFWritePos Customer.Address 7 (iStyle) -1 4.98 DFWritePos Customer.City 12 (iStyle) -1 3.98 DFWritePos Customer.State 15 (iStyle) -1 0.98 DFWritePos Customer.Zip 16 (iStyle) -1 1.98 DFWritePos Customer.Comments 18 (iStyle) -1 0 DFWriteln DFWriteln End_Procedure // Body Procedure Page_Bottom DateTime dtDT string sFont integer iSize iStyle iBorder iFill Move (CurrentDateTime()) to dtDT Move "Arial" to sFont Move 8 to iSize Move rgb_dBlue to iStyle Move rgb_dGrey to iBorder Move rgb_White to iFill DFFont sFont DFFontSize iSize DFBeginHeader DFPageBottom DFHeaderPos HDR_LEFT DFHeaderFrame HDR_MARGINS 0 iBorder iFill DFWriteLn ("Report Printed on: " +string(dtDT)) (iStyle+Font_Center) DFEndHeader End_Procedure End_Object // oCustomer_WinPrint
cWinReport2 objects use the same reports sections as the BasicReport. Each of these sections are represented in your report with a Procedure. For example, report_header will be represented inside of "Procedure report_header". All sections, except the body section will use a cWinPrint2 Header that is created within your procedure using the DFBeginHeader command. For example, the report_footer procedure will contain "DFBeginHeader DFReportHeader". The following table provides information about these report sections:
Procedure Name | DFBeginHeader Name | Description |
---|---|---|
Page_top | DFPageTop | Page_top is printed first at the physical top margin of each page. |
Report_header | DFReportHeader | Report_header is printed once in a report after Page_top. |
Page_header | DFPageHeader | Page_header is printed on every page following Report_Header. Note that this is different than the BasicReport behavior. |
Page_title | DFPageTitle | Page_title appears on every page after Page_heading. |
SubHeader1..n | DFSubHeader 1..9 | Subheaders appear for each break level. They are ouput for each new break. They are usually reprinted on page breaks. |
Body | none | The Body section is called once for every valid record. There is no DFHeader associated with this. |
SubTotal1..n | DFSubTotal 1..9 | Subtotals appear for each break level. They are output at the end of a break. They are normally not reprinted on page breaks. |
Total | DFTotal | The Total section appears once at the end of a report following all sub-totals. |
Report_footer | DFReportFooter | Report_footer is printed once on the last page before Page_footer. |
Page_footer | DFPageFooter | Page_footer is printed on every page before Page_bottom. Note that this is different than the BasicReport behavior. |
Page_bottom | DFPageBottom | Page_Bottom is printed at the physical bottom margin of each page. |
The following constants are used by cWinReport2:
In WinPrint2, three keywords used as the argument of any of the DFWrite* commands support printing page numbers. It is very important that #pagecount#, #subpagecount# and #zerosubpagecount# are written in lowercase letters and enclosed in quotation marks.
#pagecount# prints page numbers that increment from the beginning of the report to the end.
DFWriteLn '#pagecount#' (FONT_RIGHT) DFWriteLnPos '#pagecount#' 5 (FONT_DEFAULT)
#subpagecount# prints page numbers that increment until a #zerosubpagecount# is executed, at which point they resume incrementing from 1. #subpagecount# would typically be used in Sections pageTop and pageBottom.
DFWriteLn '#subpagecount#' FONT_DEFAULT DFWriteLnPos '#subpagecount#' 5 FONT_DEFAULT
If you have a report printing multi-page invoices and you want each invoice to start with Page 1, then you should use #subpagecount# and zerosubpagecount#.
#zerosubpagecount# zeroes the #subpagecount# counter. You must do a #zerosubpagecount# before you create a new page. #zerosubpagecount# would typically be used in a Section subTotal or subHeader. #zerosubpagecount# must be used inside a DFBeginHeader...DFEndHeader block.
DFWrite '#zerosubpagecount#'
Because the numbering of report pages and section pages is done with different arguments, you can have a report whose pages are numbered both ways, if you wish.
Many of the commands in WinPrint2 use named constants as arguments. Certain arguments can only be one of the named constants. These constants include font attributes, colors, and print dialog/setup flags.
These named constants, along with all colors, can be used in attributes in DFWrite... statements. When used more than one at a time in a statement, they should be separated by plus (+) signs and all enclosed together by a single pair of parentheses.
FONT_DEFAULT | Font with no attributes |
FONT_UNDER | Underline attribute |
FONT_BOLD | Bold attribute |
FONT_ITALIC | Italic attribute |
FONT_STRIKE | Strikeout attribute |
FONT_LEFT | Output left-justified to the margin, column, or position. |
FONT_CENTER | Output centered on position, in the column, or between the margins. |
FONT_RIGHT | Output right-justified to the margin, column, or position. |
These constants provide a convenience for outputting in various standard colors. They can be used with all commands that take color as an argument, including in attributes in DFWrite... statements. With the DFGetDFColor function, you can create any color you desire for output.
Regular colors | Dark colors |
---|---|
RGB_BLACK | |
RGB_WHITE | |
RGB_BLUE | RGB_DBLUE |
RGB_CYAN | RGB_DCYAN |
RGB_GREEN | RGB_DGREEN |
RGB_GREY | RGB_DGREY |
RGB_MAGENTA | RGB_DMAGENTA |
RGB_RED | RGB_DRED |
RGB_YELLOW | RGB_DYELLOW |
Page Orientation (landscape or portrait) is controlled using the DFSetLandscape and DFGetLandscape messages.
The paper bin is contolled using the DFSetPrinterBin, DFGetPrinterBin and DFPrinterBinFirstPage messages. The following bin types may be selected:
DF_BIN_AUTO |
DF_BIN_CASSETTE |
DF_BIN_ENVELOPE |
DF_BIN_ENVMANUAL |
DF_BIN_FIRST |
DF_BIN_LARGECAPACITY |
DF_BIN_LARGEFMT |
DF_BIN_LAST |
DF_BIN_LOWER |
DF_BIN_MANUAL |
DF_BIN_MIDDLE |
DF_BIN_ONLYONE |
DF_BIN_SMALLFMT |
DF_BIN_TRACTOR |
DF_BIN_UPPER |
Paper size is controlled using the DFSetPrinterPaper, DFGetPrinterPaper, DFSetUserDefinedPapersize, DFGetUserDefinedLength and DFGetUserDefinedWidth messages. The following paper sizes may be selected
DF_PAPER_10X14 | 10 by 14 inch sheet |
DF_PAPER_11X17 | 11 by 17 inch sheet |
DF_PAPER_A3 | A3 sheet, 297 by 420 millimeters |
DF_PAPER_A4 | A4 Sheet, 210 by 297 millimeters |
DF_PAPER_A4SMALL | A4 small sheet, 210 by 297 millimeters |
DF_PAPER_A5 | A5 sheet, 148 by 210 millimeters |
DF_PAPER_B4 | B4 sheet, 250 by 354 millimeters |
DF_PAPER_B5 | B5 sheet, 182 by 257 millimeter paper |
DF_PAPER_CSHEET | C Sheet, 17 by 22 inches |
DF_PAPER_DSHEET | D Sheet, 22 by 34 inches |
DF_PAPER_ENV_10 | #10 Envelope, 4 1/8 by 9 1/2 inches |
DF_PAPER_ENV_11 | #11 Envelope, 4 1/2 by 10 3/8 inches |
DF_PAPER_ENV_12 | #12 Envelope, 4 3/4 by 11 inches |
DF_PAPER_ENV_14 | #14 Envelope, 5 by 11 1/2 inches |
DF_PAPER_ENV_9 | #9 Envelope, 3 7/8 by 8 7/8 inches |
DF_PAPER_ENV_B4 | B4 Envelope, 250 by 353 millimeters |
DF_PAPER_ENV_B5 | B5 Envelope, 176 by 250 millimeters |
DF_PAPER_ENV_B6 | B6 Envelope, 176 by 125 millimeters |
DF_PAPER_ENV_C3 | C3 Envelope, 324 by 458 millimeters |
DF_PAPER_ENV_C4 | C4 Envelope, 229 by 324 millimeters |
DF_PAPER_ENV_C5 | C5 Envelope, 162 by 229 millimeters |
DF_PAPER_ENV_C6 | C6 Envelope, 114 by 162 millimeters |
DF_PAPER_ENV_C65 | C65 Envelope, 114 by 229 millimeters |
DF_PAPER_ENV_DL | DL Envelope, 110 by 220 millimeters |
DF_PAPER_ENV_ITALY | Italy Envelope, 110 by 230 millimeters |
DF_PAPER_ENV_MONARCH | Monarch Envelope, 3 7/8 by 7 1/2 inches |
DF_PAPER_ENV_PERSONAL | 6 3/4 Envelope, 3 5/8 by 6 1/2 inches |
DF_PAPER_ESHEET | E Sheet, 34 by 44 inches |
DF_PAPER_EXECUTIVE | Executive, 7 1/4 by 10 1/2 inches |
DF_PAPER_FANFOLD_LGL_GERMAN | German Legal Fanfold, 8 1/2 by 13 inches |
DF_PAPER_FANFOLD_STD_GERMAN | German Std Fanfold, 8 1/2 by 12 inches |
DF_PAPER_FANFOLD_US | US Std Fanfold, 14 7/8 by 11 inches |
DF_PAPER_FOLIO | Folio, 8 1/2 by 13 inch paper |
DF_PAPER_LEDGER | Ledger, 17 by 11 inches |
DF_PAPER_LEGAL | Legal, 8 1/2 by 14 inches |
DF_PAPER_LETTER | Letter, 8 1/2 by 11 inches |
DF_PAPER_LETTERSMALL | Letter Small, 8 1/2 by 11 inches |
DF_PAPER_NOTE | Note, 8 1/2 by 11 inches |
DF_PAPER_QUARTO | Quarto, 215 by 275 millimeter paper |
DF_PAPER_STATEMENT | Statement, 5 1/2 by 8 1/2 inches |
DF_PAPER_TABLOID | Tabloid, 11 by 17 inches |
DF_PAPER_USER | User defined paper size, used in conjunction with DFSetUserDefinedPapersize |
Printer resolution is controlled using the DFSetPrinterResolution and DFGetPrinterResolution messages. The following resolutions may be selected:
DF_RES_DRAFT |
DF_RES_HIGH |
DF_RES_LOW |
DF_RES_MEDIUM |
In WinPrint2 a special symbol is used as the argument of any of the DFWrite* commands to support printing the Euro symbol. It is important that the #euro# symbol is written in lowercase and enclosed in a literal string. e.g. "#euro#".
DFWritePos "The Euro symbol looks like this: #euro#" 5 DFWritePos ("#euro#" + string(Customer.Balance)) 10
The following commands are used by WinReport:
DFBeginHeader starts the definition of section headers and footers in the output.
DFBeginHeader {header-type} [{level#}]
Argument | Type | Explanation | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Header-type | constant | Type of Header. Must be one of thefollowing constants
| ||||||||||||||||||||||||||
level# | integer | Section level number (only used with DFSubHeader or DFSubTotal) |
DFBeginHeader DFSubHeader 1 DFHeaderWrap HDR_NOWRAP DFHeaderPos HDR_LEFT DFHeaderFrame HDR_MARGINS DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD +RGB_RED) 1.5 DFWritelnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFEndHeader
DFEndHeader ends a section header or footer begun with DFBeginHeader.
DFEndHeader
DFBeginHeader DFSubHeader 1 DFHeaderWrap HDR_NOWRAP DFHeaderPos HDR_LEFT DFHeaderFrame HDR_MARGINS DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD +RGB_RED) 1.5 DFWritelnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFEndHeader
DFFont sets the default font to any valid Windows font.
DFFont {fontname}
Argument | Type | Explanation |
---|---|---|
fontname | string | Any font valid in the Windows installation |
DFFont 'Arial' DFFont 'Times New Roman'
DFFontSize sets the font size to any valid size for that font
DFFontSize {height}
Argument | Type | Explanation |
---|---|---|
height | number | Height of font in points |
DFFontSize 14
DFHeaderFrame sets the frame style of a header or footer section.
DFHeaderFrame {style} [{border_width} [{border_color} [{fill_color}]]]
Argument | Type | Explanation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
style | constant | Frame style. Must be one of the following constants.
| ||||||||
border_width | number | Optional. Width of border (using current metrics) | ||||||||
border_color | number | Optional. Border Color | ||||||||
fill_color | consant | Optional. Fill Color |
DFBeginHeader DFSubHeader 1 DFHeaderPos HDR_LEFT DFHeaderFrame HDR_MARGINS 0.1 RGB_BLACK RGB_CYAN DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD) DFWriteLnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFEndHeader
DFHeaderLineCheck specifies that the header plus a specified number of lines fits on a page.
DFHeaderLineCheck {lines}
Argument | Type | Explanation |
---|---|---|
lines | integer | Number of lines to check (in addition to the header) |
DFBeginHeader DFSubHeader 1 DFHeaderLineCheck 4 DFHeaderPos HDR_LEFT DFHeaderFrame HDR_MARGINS DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD) 1.5 DFWriteLnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFEndHeader
DFHeaderMargin sets inner and outer padding for top and bottom margins in a header
DFHeaderMargin ePadPosition nPadding
Argument | Type | Explanation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ePadPosition | constant | Location for padding
| ||||||||||
nPaddding | number | Amount of space (padding) in current metrics. |
DFBeginHeader DFSubHeader 1 DFHeaderLineCheck 4 DFHeaderPos HDR_LEFT DFHeaderFrame HDR_MARGINS DFHeaderMargin HM_TopOuter 0.04 DFHeaderMargin HM_TopInner 0.01 DFHeaderMargin HM_BottomInner 0.01 DFHeaderMargin HM_BottomOuter 0.10 DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD) DFWriteLnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFEndHeader
DFHeaderPos positions the section header according to a justification mode
DFHeaderPos {justification}
Argument | Type | Explanation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
justification | constant | Justification mode. Must be one of the following constants
|
DFBeginHeader DFSubHeader 1 DFHeaderWrap HDR_NOWRAP DFHeaderPos HDR_LEFT DFHeaderFrame HDR_FRMSIZE DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD) 1.5 DFWritePos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFWriteLn Customer.Address (FONT_ITALIC +FONT_BOLD+FONT_RIGHT) DFEndHeader
DFHeaderWrap tells a header section to reprint at the top of the new page
DFHeaderWrap {wrap}
Argument | Type | Explanation | ||||||
---|---|---|---|---|---|---|---|---|
wrap | constant | Wrap mode. Must be one of the following constants.
|
DFBeginHeader DFSubHeader 1 DFHeaderWrap HDR_NOWRAP DFHeaderPos HDR_LEFT DFHeaderFrame HDR_MARGINS DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD) DFWriteLnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFEndHeader
This command may be used only in a header or footer section begun by DFBeginHeader.
DFLineCheck checks that a given number of lines fit on the page
DFLineCheck {lines}
Argument | Type | Explanation |
---|---|---|
lines | integer | Number of lines to check for |
DFLineCheck 3 DFWriteLnPos Customer.Recnum 2 (FONT_ITALIC +FONT_BOLD) DFWriteLnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD) DFWriteLnPos Customer.Address 2 (FONT_ITALIC +FONT_BOLD)
The DF Margin commands set the margins of your document
DFTopMargin {position}
DFBottomMargin {position}
DFLeftMargin {position}
DFRightMargin {position}
Argument | Type | Explanation |
---|---|---|
position | number | Margin in the current metrics |
DFTopMargin 1.25 DFBottomMargin 1.25 Send DFSetMargins nLeft nTop nRight nBottom
All the position measurements (vert, horz, etc.) of the other commands are taken vertically down from the top margin and horizontally right from the left margin.
DFWrite appends data to the current line
DFWrite {variable} [{attributes} [{decimal-places}]]
Argument | Type | Explanation |
---|---|---|
variable | string | A literal, variable, or database field whose value is to be output |
attributes | constant | Optional. Font attributes and colors |
decimal_places | integer | Optional. Number of digits to the right of the decimal for numeric values |
DFWrite "Balance" (FONT_ITALIC +FONT_BOLD +RGB_RED) DFWrite product.description (FONT_DEFAULT) DFWrite 12345.67 (FONT_ITALIC +RGB_BLUE) 2
DFWriteBMP is used to place an image on the page.
DFWriteBMP supports .BMP (standard Windows bit-mapped graphics format), .RLE (run-length encoded graphics), .JPG/.JPEG (Joint Photographic Experts Group graphics), .ICO (icon files), .WMF (Windows meta files) and .EMF (extended/enhanced Windows meta files).
DFWriteBMP {path\filename} {vert_Location} {horz_Location} {height} {width} [{update_cur_pos}]
Argument | Type | Explanation | ||||||
---|---|---|---|---|---|---|---|---|
path\filename | string | Name and path of image file | ||||||
vert | number | Location (upper-left corner) vertical coordinate. DFGR_CURRLINE= current line position | ||||||
horz | number | Location (upper-left corner) horizontal coordinate. DFGR_CURRLINE= current line position | ||||||
vert_Location | number | (upper-left corner) vertical coordinate in the current metrics | ||||||
horz_Location | number | (upper-left corner) horizontal coordinate in the current metrics | ||||||
height | number | Height of bitmap in the current metrics | ||||||
width | number | Width of bitmap in the current metrics | ||||||
update_cur_pos | constant | Optional. Determines where current position pointer will be placed
|
DFWriteBMP 'UGLYFACE.BMP' 2 10 4 3 DFGR_NOPOS DFWriteBMP "logo.jpg" 14 7 12 9 DFGR_NOPOS
DFWriteEllip writes an ellipse to the page.
DFWriteEllip {vert} {horz} {height} {width} [{border_color} [{border-width} [{reprint} [{fill_color} [{update_cur_pos}]]]]]
Argument | Type | Explanation | ||||||
---|---|---|---|---|---|---|---|---|
vert | number | Location (upper-left corner) vertical coordinate in the current metrics. DFGR_CURRLINE= current line position | ||||||
horz | number | Location (upper-left corner) horizontal coordinate in the current metrics. DFGR_CURRLINE= current line position | ||||||
height | number | Height of the ellipse in the current metrics. DFGR_RB_MARGIN = height of entire header | ||||||
width | number | Width of the ellipse in the current metrics. DFGR_RB_MARGIN = width of header / width of page | ||||||
border_color | constant | Optional. Border lines color (default black) | ||||||
border_width | constant | Optional. Width of border lines in the current metrics | ||||||
reprint | constant | Optional. Determines if graphic is reprinted in succeeding page
| ||||||
fill_color | constant | Optional. Fill color(default transparent) | ||||||
update_cur_pos | constant | Optional. Determines where current position pointer will be placed
|
DFWriteEllip 2 4 6 4 RGB_BLACK 0.1 DFGR_NOWRAP RGB_RED DFGR_NOPOS DFWriteEllip 0 0 DFGR_RB_MARGIN DFGR_RB_MARGIN 0.3
DFWriteLine is used to output a graphic line (rule) to a page.
DFWriteLine {vert} {horz} {length} [{orientation} [{color} [{width} [{update_cur_pos}]]]]
Argument | Type | Explanation | ||||||
---|---|---|---|---|---|---|---|---|
vert | number | Location (upper or left end) vertical coordinate in the current metrics. DFGR_CURRLINE= current line position | ||||||
horz | number | Location (upper or left end) horizontal coordinate in the current metrics. DFGR_CURRLINE= current line position | ||||||
length | number | Length of line in the current metrics. DFGR_RB_MARGIN = height/width of entire header/page as appropriate. | ||||||
orientation | constant | Optional. Determines if line is horizontal of vertical.
| ||||||
color | constant | Optional. Line color(default black) | ||||||
width | number | Optional. Width of line in the current metrics | ||||||
update_cur_pos | constant | Optional. Determines where current position pointer will be placed
|
DFWriteLine 2 4 6 DFGR_HORI RGB_RED 0.1 DFGR_NOPOS DFWriteLine DFGR_CURRLINE 3 DFGR_RB_MARGIN DFGR_VERT
DFWriteLn writes data to the current output line and begins a new output line.
DFWriteLn {variable} [{attributes} [{decimal-places}]]
Argument | Type | Explanation |
---|---|---|
variable | A literal, variable, or database field whose value is to be output | |
attributes | Font attributes and colors | |
decimal_places | Optional. Number of digits to the right of the decimal for numeric values |
DFWriteln "End of report" (FONT_ITALIC +FONT_BOLD +RGB_RED) DFWriteln visitors.id (FONT_DEFAULT) DFWriteln 12345.67 (FONT_ITALIC +RGB_BLUE) 2
DFWriteLnPos appends data to the current line at a specified position from the left margin and begins a new output line.
DFWriteLnPos {variable} {position} [{attributes} [{decimal_places} [{MaxLength}]]]
Argument | Type | Explanation |
---|---|---|
variable | string | A literal, variable, or database field whose value is to be output |
position | number | Position to write at in the current metrics |
attributes | constant | Optional. Font attributes and colors |
decimal_places | integer | Optional. Number of digits to the right of the decimal for numeric values. Pass -1 for no-decimal places (i.e., a string output). |
MaxLength | number | Optional. Determines maximum length of output value using the current system metrics (Inch or Cm) |
DFWriteLnPos Customer.Name 10 DFWriteLnPos Customer.Name 10 FONT.DEFAULT DFWriteLnPos Customer.Name 10 FONT.DEFAULT -1 DFWriteLnPos Customer.Name 10 FONT.DEFAULT -1 0
If you use FONT_LEFT, FONT_CENTER or FONT_RIGHT in attributes, the text will be justified to the position.
DFWriteLnPos "Felons at Large" 0.5 (FONT_ITALIC +FONT_BOLD +RGB_RED) -1 10 DFWriteLnPos ammo.caliber 5 (FONT_DEFAULT) -1 5 DFWriteLnPos 12345.67 12.5 (FONT_ITALIC +RGB_BLUE) 2 4
DFWritePos appends data to the current line at a specified position from the left margin.
DFWritePos {variable} {position} [{attributes} [{decimal_places} [{MaxLength}]]]
Argument | Type | Explanation |
---|---|---|
variable | string | A literal, variable, or database field whose value is to be output |
position | number | Position to write at in the current metrics |
attributes | constant | Optional. Font attributes and colors |
decimal_places | integer | Optional. Number of digits to the right of the decimal for numeric values. Pass -1 for no-decimal places (i.e., a string output). |
MaxLength | number | Optional. Determines maximum length of output value using the current system metrics (Inch or Cm) |
DFWritePos Customer.Name 10 DFWritePos Customer.Name 10 FONT.DEFAULT DFWritePos Customer.Name 10 FONT.DEFAULT -1 DFWritePos Customer.Name 10 FONT.DEFAULT -1 0
If you use FONT_LEFT, FONT_CENTER or FONT_RIGHT in attributes, the text will be justified to the position.
DFWritePos "Prior Convictions" 0.5 (FONT_ITALIC +FONT_BOLD +RGB_RED) -1 10 DFWritePos sentence.length 5 (FONT_DEFAULT) -1 5 DFWritePos 12345.67 12.5 (FONT_ITALIC +RGB_BLUE) 2 4
DFWriteRect is used to write a rectangle to the page. DFWriteRect is very useful to place borders around section headers and/or footers.
DFWriteRect {vert} {horz} {height} {width} [{line_color} [{line_width} [{reprint} [{fill_color} [{update_cur_pos}]]]]]
Argument | Type | Explanation | ||||||
---|---|---|---|---|---|---|---|---|
vert | number | Location (upper-left corner) vertical coordinate. DFGR_CURRLINE= current line position | ||||||
horz | number | Location (upper-left corner) horizontal coordinate. DFGR_CURRLINE= current line position | ||||||
height | number | Height of rectangle in the current metrics. DFGR_RB_MARGIN = height of entire header | ||||||
width | number | Width of rectangle in the current metrics. DFGR_RB_MARGIN = width of header / width of page | ||||||
line_color | constant | Optional. Color of rectangle border lines (default black) | ||||||
line_width | number | Optional. Width of rectangle border lines in the current metrics | ||||||
reprint | constant | Optional. determines if graphic is reprinted on each page.
| ||||||
fill_color | constant | Optional. Fill Color (default transparent) | ||||||
update_cur_pos | constant | Optional. Determines where current position pointer will be placed
|
DFWriteRect 2 4 6 4 RGB_BLACK 0.1 DFGR_NOWRAP ; RGB_RED DFGR_NOPOS DFWriteRect 0 0 DFGR_RB_MARGIN DFGR_RB_MARGIN RGB_BLACK 0.3
DFWriteXYLine is used to place a line (rule) on the page from one point to another.
DFWriteXYLine {vert} {horz} {vert_stop} {horz_stop} [{color} [{width} [{reprint} [{update_cur_pos}]]]]
Argument | Type | Explanation | ||||||
---|---|---|---|---|---|---|---|---|
vert | number | Start location vertical coordinate in the current metrics. DFGR_CURRLINE= current line position. | ||||||
horz | number | Start location horizontal coordinate in the current metrics. DFGR_CURRLINE= current line position. | ||||||
vert_stop | number | Stop location vertical coordinate in the current metrics.DFGR_RB_MARGIN = height of entire header. | ||||||
horz_stop | number | Stop location horizontal coordinate in the current metrics. DFGR_RB_MARGIN = width of header / width of page. | ||||||
color | constant | Optional. Line Color (default black) | ||||||
width | number | Optional. Width of line in the current metrics | ||||||
reprint | constant | Optional. Determines how line is drawn on pages
| ||||||
update_cur_pos | constant | Optional. Determine how current line is affected
|
DFWriteXYLine 0 0 DFGR_RB_MARGIN DFGR_RB_MARGIN RGB_BLACK 0.1 DFGR_WRAP ; DFGR_NOPOS DFWriteXYLine 1 1 10 15 RGB_BLACK
This command defines the breakpoints needed in a report.
Object oReport is a cWinReport2 Report_Breaks OrderHea.Customer_Number :
Object oReport is a cWinReport2 Report_Breaks Customer.Region Customer.SubRegion :
The breakpoints can be just about anything. They can be a file.field , they can be a variable, or they can be a built-in or a user-defined function.
Object oReport is a cWinReport2 Report_Breaks (SomeBreakFunction(self))
Report_Breaks (Left(Vndr.Name, 1)) Vndr.Name Report_Breaks (G_Func(Desktop, Vndr.Id)) Report_Breaks (L_Func(Self, Vndr.Due))
The report_breaks command actually creates a custom function named test_breakpoints. Therefore, when used in a class, the report_breaks command must not be placed in a procedure or function, but should be placed directly inside the class. The following example shows how a cWinReport2 subclass should be created using the various report_???? commands.
Class cVReport is a cWinReport2 Report_Breaks (left(Vndr.name, 1)) Vndr.Name Procedure Construct_Object integer iMyImage Forward Send Construct_Object iMyImage Report_Main_File Vndr Report_Index by Vndr.Name End_Procedure : End_Class
Report_Data_Set is an obsolete command. You should always use the Set Server property to define the main file in a report.
Object oVndrReport is a cWinReport2 Set Server to oVndr_DD Set Ordering to 2 Report_Breaks Vendor.State :
Report_Index is an obsolete command. You should always use set Ordering to set the ordering of a report.
Object oVndrReport is a cWinReport2 Set Server to oVndr_DD Set Ordering to 2 Report_Breaks Vendor.State :
Report_Main_File is an obsolete command. You should always use set Main_File to set the main file of a report.
Object oVndrReport is a cWinReport2 Set Server to oVndr_DD Set Main_File to Vndr.File_Number Report_Breaks Vendor.State :