Class: WinReport
Properties | Events | Methods | Index of Classes
Provides most of the capabilities of the BasicReport class and provides the ability to use WinPrint to provide more-graphical reports
Hierarchy
cObject > Report > Report_DS > BasicReport > WinReport
Show full hierarchy and direct subclasses
- cObject
- Report
- Report_DS
- BasicReport
- WinReport
Library: Windows Application Class Library
Package: DFWinRpt.pkg
Description
This class is obsolete. It has been replaced with the cWinReport2 class.
The WinReport class is a subclass of BasicReport. This provides most of the capabilities of the BasicReport class and provides the ability to use WinPrint 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 WinPrint command extensions.
To support printing of reports in Windows (proportional) fonts. All reporting functions are supported, including the drawing of pie, bar, and line charts directly from database data. WinReports can be nested. 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.
The Constants Interface
The WinReport class uses a number of constants created for use by this class and its subclasses. Those constants are: Page Numbering#pagecount##subpagecount##zerosubpagecount#Named ConstantsFont AttributesColorsSet in Print Dialog/SetupDefault OrientationDefault Paper BinDefault Paper SizeDefault Printer ResolutionPagesPrint to File
The Command Interface
The WinReport class uses a number of commands created for use by this class and its subclasses. Those commands are: DFBeginDiagramDFBeginHeaderDFCreateDiagramDFDiagram_ItemDFDiagramLabelDFDiagramXLabelDFDiagramYLabelDFEndDiagramDFEndHeaderDFFontDFFontSizeDFHeaderFrameDFHeaderLineCheckDFHeaderPosDFHeaderWrapDFLineCheckDFTopMarginDFBottomMarginDFLeftMarginDFRightMarginDFSetMarginsDFWriteDFWriteBMPDFWriteColDFWriteDiagramDFWriteEllipDFWriteLineDFWriteLnDFWriteLnColDFWriteLnPosDFWritePosDFWriteRectDFWriteXYLineProcedure_SectionReport_BreaksReport_Data_SetReport_IndexReport_Main_FileZero_Subtotals
Sample 1
Object oRpt_W1e is a WinReport
Report_Main_File Customer
Set Report_Title to "Printing Customer Names"
Function Starting_Main_Report Returns Integer
Integer iRetVal iIdOrderState
Forward Get Starting_Main_Report to iRetVal
// We don't know the index order until the report starts. That is
// why we set ORDERING here in this procedure.
Delegate Get Id_Order_State to iIdOrderState
If (iIdOrderState) ;
Report_Index by Customer.Recnum
Else ;
Report_Index by Customer.Customer
End_Function
Procedure_Section Page_Top
DFFont "Arial" //Using Arial font size 20
DFFontSize 20
DFBeginHeader DFPageTop //Header of type DFPageTop
DFHeaderPos HDR_LEFT //Data in header left justify
DFHeaderFrame HDR_MARGINS //Paint frame margin to margin
//Writeline data at position 3 cm
DFWritelnPos "Customer Name Listing" 3 (FONT_BOLD)
//Use font size 16
DFFontSize 16
//Write data at posistion 0.5 cm
DFWritePos "Cst Id" 0.5 (FONT_ITALIC)
//Write data at pos 4 cm
DFWritePos "Name" 4 (FONT_ITALIC)
//Write data at pos 12 cm
DFWritePos "Page:" 12 (FONT_ITALIC+FONT_BOLD)
//Writeln page counter at.
//#pagecount# MUST be in small letters
DFWritePos "#pagecount#" 14 (FONT_ITALIC+FONT_BOLD)
//End header and print header
DFEndHeader
//*** Write BMP at pos from margins using curent metrics
//*** At pos. 1 cm down 11 cm to right from the margin
//*** Size 4 height 3 width
DFWriteBMP "LOGO2.BMP" 1 11 4 3
//DFWriteln "" //Don't do this in this section!
//If you do, you will have problems
End_Procedure
Procedure_Section Body
Send Update_Status ((String(Customer.Recnum)) * ":" * (Customer.Customer))
DFFont "Times New Roman" //Use font Times New Roman
DFFontSize 14 //font size 14
DFLineCheck 20
//Write date to pos 0.5 cm using italics
DFWritePos Customer.Recnum 0.5 (FONT_ITALIC)
//Writeln dat to pos 4 cm using italics
DFWritelnPos Customer.Customer 4 (FONT_ITALIC)
End_Procedure
Procedure_Section Page_Bottom
DFFont "Arial"
DFFontSize 10
DFBeginHeader DFPageBottom //Header of type DFPageBottom
DFHeaderPos HDR_CENTER //Center the data in the header
DFHeaderFrame HDR_MARGINS //Frame margin to margin
DFWrite "WinRpt1e Sample: Printed on: " (FONT_ITALIC)
//Using property in WinReport to set date
DFWriteln (RptToday(self)) (FONT_ITALIC)
DFEndHeader
End_Procedure
End_Object
Sample 2
// WRPt1.Rpt
Object oCust_Report2 is a WinReport
Report_Main_File Customer
Report_Index by Customer.Name
Set Report_Title to "Printing Customer Names" // Status panel title
Procedure_Section Page_Top
DFFont "Arial" //Using Arial font size 20
DFFontSize 20
DFBeginHeader DFPageTop //Header of type DFPageTop
DFHeaderPos HDR_LEFT //Data in header left justify
DFHeaderFrame HDR_MARGINS //Paint frame margin to margin
//Writeline data at position 3 cm
DFWritelnPos "Customer Name Listing" 3 (FONT_BOLD)
//Use font size 16
DFFontSize 16
//Write data at position 0.5 cm
DFWritePos "Cst Id" 0.5 (FONT_ITALIC)
//Write data at pos 4 cm
DFWritePos "Name" 4 (FONT_ITALIC)
//Write data at pos 12 cm
DFWritePos "Page:" 12 (FONT_ITALIC+FONT_BOLD)
//Writeln page counter at.
//#pagecount# MUST be in small letters
DFWritePos "#pagecount#" 14 (FONT_ITALIC+FONT_BOLD)
DFEndHeader
End_Procedure
Procedure_Section Body
Send Update_Status Customer.Name
DFFont "Times New Roman" //Use font Times New Roman
DFFontSize 14 //font size 14
DFLineCheck 20
//Write date to pos 0.5 cm using italics
DFWritePos Customer.Number 0.5 (FONT_ITALIC)
//Writeln dat to pos 4 cm using italics
DFWritelnPos Customer.Name 4 (FONT_ITALIC)
End_Procedure
Procedure_Section Page_Bottom
DFFont "Arial"
DFFontSize 10
DFBeginHeader DFPageBottom //Header of type DFPageBottom
DFHeaderPos HDR_CENTER //Center the data in the header
DFHeaderFrame HDR_MARGINS //Frame margin to margin
DFWrite "Win Report Sample: Printed on: " (FONT_ITALIC)
//Using property in DFReport to set date
DFWriteln (RptToday(Self)) (FONT_ITALIC)
DFEndHeader
End_Procedure
End_Object
Within the report view (or panel), the report would be started by creating the following procedure:
Procedure StartReport
Boolean bToScreen
Get Print_to_Screen_State to bToScreen
If (bToScreen) ;
Set OutPut_Device_Mode to PRINT_TO_WINDOW
Else ;
Set OutPut_Device_Mode to PRINT_TO_PRINTER
Send Run_Report
End_Procedure
Syntax
use dfWinRpt.pkg
Object oObjectName is a WinReport ;
[main_file mainfileName [by IndexNumber [break var1 [... varN]]]
[set Server to DDOName]
Report_Main_File mainfileName
Report_Index {by | down} {IndexNumber | file.field}
Report_Breaks var1 [... varN]
Report_Data_Set data_set
begin_constraints
constrain ...
end_constraints
procedure_section sectionName
:
end_procedure
procedure_section ...
:
end_procedure
end_object
Argument Explanation
| Constant | Meaning |
|---|---|
| oObjectName | The name of the object. |
| mainfileName | The name of the main database file. |
| IndexNumber | Identifies the index of mainfileName to use for ordering output. |
| file.field | Identifies the field of mainfileName whose Main Index is to be used for ordering output. |
| varN | The variable or expression, a change in the value of which is to trigger a break at Level N. |
| sectionName | The predefined name of an optional functional section of the object. There may be one section each for any or all of report_header, page_header, page_top, page_title, subHeader_initN, subHeaderN, body, page_total, page_footer, page_bottom, report_footer, filler, subTotalN, and total. N can be 0 through 9. |
| DDOname | The name of the DataDictionary object through which this object accesses the database. Also the initial value of this object's server property. |
Of Special Note
This class does not use images, as it is designed to handle proportional fonts in multiple sizes in a given report. It is also capable of outputting all font attributes, such as bold, italics, etc. It outputs the entire report to memory before any of the report can be viewed.
Objects of this class are not capable of "intelligent" page breaking; the only programmable page-breaking capability in this class is the DFNewPage procedure. "Intelligent" page breaking is handled by the WinPrint DLL. Where you unconditionally desire a page break in your report (as at the triggering of a certain level of section break), using DFNewPage is highly recommended, as it obviates a great deal of computation that otherwise would take place.
A global integer WinPrintID contains the object Id of the WinPrint object in each program that has one. This should be used for faster and easier access to this object. You can use Send message to WinPrintId instead of Send message to (WinPrintObj(self)).
When report objects are nested, all subtotals for all objects are stored in the outer object. This means you don't have to keep track of which object contains each subtotal.
Some things to note about a WinReport object: The overall structure of this object is the same as the BasicReport object. The sections are the same, the processing is the same, the status panel is the same, and the error handling is the same. The main difference is the method of output. Output is defined with a number of special WinPrint commands. These commands are used to define font style, size, orientation, placement. Examples of these commands are DFBeginHeader, DFfEndHeader, DFFonts, DFFontSize and DFWrite. Output can be directed to a printer or to the WinPrint print preview panel. This is controlled by setting the output_device_mode property in the report view. The WinPrint preview panel is very powerful. It allows you to can change paper size, orientation, and printer type. You may view the report on the screen or you may choose to print the report. If a report is interrupted (the status-panel cancel button is pressed) the user is given the choice of stopping the report, canceling the report, or, previewing the report's current progress. This preview process can be very useful when running long reports.
Constants Used By WinReport
The constants described below are available for use in any object in which a use df_print command has been placed. The following constants are used by WinReport: Page NumberingpagecountsubpagecountzerosubpagecountNamed ConstantsFont AttributesColorsSet in Print Dialog/SetupDefault OrientationDefault Paper BinDefault Paper SizeDefault Printer ResolutionPagesPrint to File
Page Numbering
In WinPrint, three keywords used as the first argument (variable) 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
pagecount# prints page numbers that increment from the beginning of the report to the end.
DFWriteLn '#pagecount#' (FONT_DEFAULT)
DFWriteLnCol '#pagecount#' 2 (FONT_DEFAULT)
DFWriteLnPos '#pagecount#' 5 (FONT_DEFAULT)
#subpagecount
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
DFWriteLnCol '#subpagecount#' 2 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
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.
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. Named Constants Many of the commands in WinPrint 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.
Font Attributes
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.
| Col 1 | Col 2 |
|---|---|
| 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. |
Colors
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.
RGB_BLACK
RGB_BLUE
RGB_CYAN
RGB_GREEN
RGB_GREY
RGB_MAGENTA
RGB_RED
RGB_WHITE
RGB_YELLOW
Dark colors: RGB_DBLUE RGB_DCYAN RGB_DGREEN RGB_DGREY RGB_DMAGENTA RGB_DRED RGB_DYELLOW
Set in Print Dialog/Setup
All flags are divided into groups. You can only combine one flag from each group, (e.g., it is invalid to combine both DF_PAPER_A4 and DF_PAPER_A3, because this would be a conflict). Default Orientation This group controls the default orientation of the document.
| Flag | Description |
|---|---|
| DF_PORTRAIT | Selects portrait mode. |
| DF_LANDSCAPE | Selects landscape mode. |
| Default Paper Bin | |
| This group controls the default paper bin to use. These values are driver dependent. The names of most of these flags are self explanatory. |
| Flag | |---| | DF_BIN_AUTO | | DF_BIN_ENVELOPE | | DF_BIN_FIRST | | DF_BIN_LARGEFMT | | DF_BIN_LOWER | | DF_BIN_MIDDLE | | DF_BIN_SMALLFMT | Default Paper Size This group controls the default paper size.
| Flag | Description |
|---|---|
| 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 | C5 Envelope, 162 by 229 millimeters |
| DF_PAPER_ENV_C4 | C3 Envelope, 324 by 458 millimeters |
| DF_PAPER_ENV_C5 | C4 Envelope, 229 by 324 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 |
Default Printer Resolution This group controls the default printer resolution. The names of most of these flags are self explanatory.
| Flag | |---| | DF_RES_DRAFT | | DF_RES_LOW | Pages This group controls the 'Pages' radio button in the Print Dialog.
| Flag | Description |
|---|---|
| DF_NOPAGENUMS | Disables the 'Pages' radio button and associated edit controls. |
| DF_PAGENUMS | Selects the 'Pages' radio button. |
| Print to File | |
| This group controls the 'print to file' checkbox in the Print Dialog. |
| Flag | Description |
|---|---|
| DF_DISABLEPRINTTOFILE | Disables the 'print to file' checkbox. |
| DF_HIDEPRINTTOFILE | Hides the 'print to file' checkbox. |
| DF_PRINTTOFILE | Shows the 'print to file checkbox,' and enables it. |
Commands Used by WinReport
The following commands are used by WinReport: DFBeginDiagramDFBeginHeaderDFCreateDiagramDFDiagram_ItemDFDiagramLabelDFDiagramXLabelDFDiagramYLabelDFEndDiagramDFEndHeaderDFFontDFFontSizeDFHeaderFrameDFHeaderLineCheckDFHeaderPosDFHeaderWrapDFLineCheckDFTopMarginDFBottomMarginDFLeftMarginDFRightMarginDFSetMarginsDFWriteDFWriteBMPDFWriteColDFWriteDiagramDFWriteEllipDFWriteLineDFWriteLnDFWriteLnColDFWriteLnPosDFWritePosDFWriteRectDFWriteXYLineProcedure_SectionReport_BreaksReport_Data_SetReport_IndexReport_Main_FileZero_Subtotals
DFBeginDiagram Obsolete
Purpose DFBeginDiagram is used together with other graphic commands to create a chart. DFBeginDiagram is a mix of DFCreateDiagram and DFWriteDiagram. Syntax DFBeginDiagram {type} {effect} {vert} {horz} {height} {width}
| Argument | Type | Explanation | Constant | Meaning | Constant | Meaning |
|---|---|---|---|---|---|---|
| type | constant Diagram Type. Must be one of the following constantsConstantMeaning | |||||
| DFGR_BAR | Bar chart | |||||
| DFGR_LINE | Line chart | |||||
| DFGR_PIE | Pie chart | |||||
| effect | constant Effect Style. Must be one of the following constantsConstantMeaning | |||||
| DFGR_2D | 2-dimensional chart with labels on right | |||||
| DFGR_3D | 3-dimensional chart with labels on right | |||||
| DFGR_2DL | 2-dimensional chart with labels on left | |||||
| DFGR_3DL | 3-dimensional chart with labels on left | |||||
| vert | number Location vertical coordinate | |||||
| horz | number Location horizontal coordinate | |||||
| height | number Height of chart | |||||
| width | number Width of chart |
It is best to use DFBeginDiagram when you do not have to mix charts within each other. If you have to mix charts within each other or if you have to create a chart before you start to use it, it is better to use DFCreateDiagram and DFWriteDiagram.
All arguments are required. Many of the arguments can be named constants.
DFBeginDiagram DFGR_BAR DFGR_2D DFGR_CURRLINE 3 4 6
DFBeginDiagram DFGR_PIE DFGR_3DL 3 3 4 6
DFBeginDiagram DFGR_LINE DFGR_3D DFGR_CURRLINE 3 4 6
DFBeginHeader
Purpose DFBeginHeader starts the definition of section headers and footers in the output. Syntax DFBeginHeader {header-type} [{level#}]
| Argument | Type | Explanation | Constant | Meaning |
|---|---|---|---|---|
| Header-type | constant Type of Header. Must be one of thefollowing constantsConstantMeaning | |||
| DFReportHeader | Once only, at beginning of report | |||
| DFPageTop | Page top | |||
| DFPageTitle | Page title | |||
| DFPageHeader | Page header | |||
| DFSubHeader | Section breaks, levels 1-9 | |||
| DFSubTotal | Section breaks, levels 1-9 | |||
| DFTotal | Total | |||
| DFPageFooter | Page footer | |||
| DFPageTotal | Page total | |||
| DFPageBottom | Page bottom | |||
| DFReportFooter | Once only, at end of report | |||
| level# | integer Section level number (only used with DFSubHeader or DFSubTotal) |
If you use Header Type DFSubHeader or DFSubTotal, level# is required. If you are defining a SubHeader1, the level# is 1, if you are defining a SubTotal2, level# is 2, and so on. In nested reports, level# should be the level of the overall report, not that of the nested report.
Do not nest the definitions of section headers and footers.
DFBeginHeader DFSubHeader 1
DFHeaderWrap HDR_NOWRAP
DFHeaderPos HDR_LEFT
DFHeaderFrame HDR_MARGINS
DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD +RGB_RED)
DFWritelnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD)
DFEndHeader
DFCreateDiagram Obsolete
Purpose DFCreateDiagram is used to create a chart Syntax DFCreateDiagram {type} {effect {height} {width}
| Argument | Type | Explanation | Constant | Meaning | Constant | Meaning |
|---|---|---|---|---|---|---|
| type | constant Diagram typeConstantMeaning | |||||
| DFGR_BAR | Bar chart | |||||
| DFGR_LINE | Line chart | |||||
| DFGR_PIE | Pie chart | |||||
| effect | constant Effect typeConstantMeaning | |||||
| DFGR_2D | 2-dimensional chart with labels on right | |||||
| DFGR_3D | 3-dimensional chart with labels on right | |||||
| DFGR_2DL | 2-dimensional chart with labels on left | |||||
| DFGR_3DL | 3-dimensional chart with labels on left | |||||
| height | number Height of chart | |||||
| width | number Width of chart |
DFCreateDiagram is used to create a chart so you can fill it with items before you write and position the chart on the page. If you use DFCreateDiagram, you must also use DFWriteDiagram. If you need to nest charts or fill them with items before you write the chart to the page, you should use DFCreateDiagram and DFWriteDiagram. When you use DFCreateDiagram, it is up to you to keep track of the diagram ID, which is used by DFWriteDiagram and DFEndDiagram
Many of the arguments can be named constants.
DFCreateDiagram DFGR_BAR DFGR_2D 4 6
DFCreateDiagram DFGR_PIE DFGR_3DL 4 6
DFCreateDiagram DFGR_LINE DFGR_3D 4 6
DFDiagram_Item Obsolete
Purpose DFDiagram_Item is used to fill a diagram with data. Syntax DFDiagram_Item {value} {label} [{val_disp} [{decimal_places} [{emphasis} [{fill_color} [{border_color} ]]]]]
| Argument | Type | Explanation | Constant | Meaning | Constant | Meaning |
|---|---|---|---|---|---|---|
| value | number Numeric value by which item is proportioned | |||||
| label | string Explanatory text for the item | |||||
| val_disp | constant Optional. Determines how the value is displayedConstantMeaning | |||||
| DFGR_NOVAL | Do not display value | |||||
| DFGR_VAL | Display value | |||||
| DFGR_PER | Display value as percent of all values | |||||
| decimal_places | integer Optional. Number of digits of value to display to the right of the decimal | |||||
| emphasis | constant Optional.ConstantMeaning | |||||
| DFGR_IN | depress slice for item | |||||
| DFGR_OUT | raise slice for item (only valid for pie diagram) | |||||
| fill_color | constant Optional. Color of fill | |||||
| border_color | constant Optional. Color of border |
DFDiagram_Item uses the current diagram ID. If you nest diagrams, it is up to you to keep track of the diagram IDs.
Many of the arguments can be named constants.
DFDiagram_Item 100.34 ""
DFDiagram_Item division.sales "Southeast" DFGR_NOVAL
DFDiagram_Item 123.45 "Tory" DFGR_VAL 1 DFGR_OUT
DFDiagram_Item 456.67 defendnt.name DFGR_PER 3 DFGR_IN ;
RGB_RED RGB_MAGENTA
If you do not specify the color(s), the color(s) will be the default(s) for the class.
DFDiagramLabel
Purpose DFDiagramLabel is used to set the top label (title) of a chart. Syntax DFDiagramLabel {text}
| Argument | Type | Explanation |
|---|---|---|
| text | string Content of the label |
DFDiagramLabel uses the current diagram. If you nest diagrams, it is up to you to keep track of the diagram ID.
DFDiagramLabel "Top label"
DFDiagramXLabel
Purpose DFDiagramXLabel is used to set the label for the horizontal axis of a bar or line chart. Syntax DFDiagramXLabel {text}
| Argument | Type | Explanation |
|---|---|---|
| text | string Content of the label |
DFDiagramXLabel uses the current diagram. If you nest diagrams, it is up to you to maintain the desired diagram ID.
DFDiagramXLabel "Fiscal Years"
DFDiagramYLabel
Purpose DFDiagramYLabel is used to label the vertical axis of a bar or line chart. Syntax DFDiagramYLabel {text} {orientation}
| Argument | Type | Explanation | Constant | Meaning |
|---|---|---|---|---|
| text | string Content of the label | |||
| orientation | constant Text OrientationConstantMeaning | |||
| DFGR_HORI | Show text horizontally | |||
| DFGR_VERT | Show text vertically (parallel to axis) |
DFDiagramYLabel is used to label the vertical axis of a bar or line chart. DFDiagramYLabel uses the current diagram. If you nest diagrams, it is up to you to maintain the desired diagram ID.
DFDiagramYLabel "Income" DFGR_HORI
DFDiagramYLabel "Gross National Product" DFGR_VERT
DFEndDiagram
Purpose DFEndDiagram locks a chart's definition Syntax DFEndDiagram
DFEndDiagram locks a chart's definition, which means that the chart cannot take any more items and the chart will be generated and printed to the page. All chart definitions must have a DFEndDiagram. DFEndDiagram acts on the dfCurrent_diagram. If you nest diagrams, it is up to you to maintain the desired diagram ID.
DFEndDiagram
DFEndHeader
Purpose DFEndHeader ends a section header or footer begun with DFBeginHeader. Syntax DFEndHeader
DFBeginHeader DFSubHeader 1
DFHeaderWrap HDR_NOWRAP
DFHeaderPos HDR_LEFT
DFHeaderFrame HDR_MARGINS
DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD +RGB_RED)
DFWriteLnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD)
DFEndHeader
DFFont
Purpose DFFont sets the default font to any valid Windows font. Syntax DFFont {fontname}
| Argument | Type | Explanation |
|---|---|---|
| fontname | string Any font valid in the Windows installation |
DFFont sets the default font to any valid Windows font. The font remains active until you change it to another font with this command.
DFFont 'Arial'
DFFont 'Times New Roman'
DFFontSize
Purpose DFFontSize sets the font size to any valid size for that font Syntax DFFontSize {height} [{width}]
| Argument | Type | Explanation |
|---|---|---|
| height | number Height of font in points | |
| width | number Optional. Width of font in points |
DFFontSize sets the font size to any valid size for that font. The size remains active until you change it to another size with this command.
If you only use height, width will be set to the default for that font for that height.
DFFontSize 14
DFFontSize 14 10
DFHeaderFrame
Purpose DFHeaderFrame sets the frame style of a header or footer section. Syntax DFHeaderFrame {style} [{border_width} [{border_color} [{fill_color}]]]
| Argument | Type | Explanation | Constant | Meaning |
|---|---|---|---|---|
| style | constant Frame style. Must be one of the following constants.ConstantMeaning | |||
| HDR_FRMSIZE | Fit to data | |||
| HDR_MARGINS | Left-margin-to-right-margin | |||
| HDR_NOFRAME | No frame | |||
| border_width | number Optional. Width of border (using current metrics) | |||
| border_color | numberOptional. Border color | |||
| fill_color | consant Optional. Fill color |
DFHeaderFrame may be used only inside a header or footer section begun with dfBeginHeader.
DFBeginHeader DFSubHeader 1
DFHeaderWrap HDR_NOWRAP
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
Purpose DFHeaderLineCheck specifies that the header plus a specified number of lines fits on a page. Syntax DFHeaderLineCheck {lines}
| Argument | Type | Explanation |
|---|---|---|
| lines | integer Number of lines to check (in addition to the header) |
Whenever a header is triggered, it automatically checks the current page to ascertain whether there is room on that page for the whole header. If not, the header will be printed on a new page. DFHeaderLineCheck enables you to specify that this check be performed for the header plus whatever number of lines you feel your program requires for a meaningful beginning of a new section. This command may be used only inside a header section begun with DFBeginHeader.
Number of lines will be checked according the font and size last used.
DFBeginHeader DFSubHeader 1
DFHeaderLineCheck 4
DFHeaderPos HDR_LEFT
DFHeaderFrame HDR_MARGINS
DFWritePos Customer.Recnum 0.5 (FONT_ITALIC +FONT_BOLD)
DFWriteLnPos Customer.Customer 2 (FONT_ITALIC +FONT_BOLD)
DFEndHeader
DFHeaderPos
Purpose DFHeaderPos positions the section header according to a justification mode Syntax DFHeaderPos {justification}
| Argument | Type | Explanation | Constant | Meaning |
|---|---|---|---|---|
| justification | constant Justification mode. Must be one of the following constantsConstantMeaning | |||
| HDR_LEFT | Justify the header or footer to the left margin | |||
| HDR_RIGHT | Justify the header or footer to the right margin | |||
| HDR_CENTER | Center the header or footer between the margins |
DFHeaderPos positions the section header or footer according to the value of justification. DFHeaderPos may be used only inside a header section.
This command may be used only in a header or footer section begun by DFBeginHeader.
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
DFHeaderWrap
Purpose DFHeaderWrap tells a header section to reprint at the top of the new page Syntax DFHeaderWrap {wrap}
| Argument | Type | Explanation | Constant | Meaning |
|---|---|---|---|---|
| wrap | constant Wrap mode. Must be one of the following constants.ConstantMeaning | |||
| HDR_NOWRAP | Header is not printed on new pages | |||
| HDR_WRAP | Header is printed on new pages |
DFHeaderWrap tells a header section to reprint at the top of the new page if a page break occurs within the section's data (before the beginning of the next section). DFHeaderWrap may be used only inside a header section begun with DFBeginHeader, and has no effect in footer-section definitions. By default, headers will not reprint.
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
Purpose DFLineCheck checks that a given number of lines fit on the page Syntax DFLineCheck {lines}
| Argument | Type | Explanation |
|---|---|---|
| lines | integer Number of lines to check for |
DFLineCheck checks that a given number of lines fit on the page. If not, a page break will be done. It is very useful where the record body has more than one line, to ensure that no record is split by a page break.
Number of lines is checked for the font and size last used in the program.
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 MarginCommands
DFLeftMargin DFTopMargin DFRightMargin DFBottomMargin Send DFSetMargins Purpose The DF Margin commands set the margins of your document Syntax DFTopMargin {position} DFBottomMargin {position} DFLeftMargin {position} DFRightMargin {position}
| Argument | Type | Explanation |
|---|---|---|
| position | number Margin in the current metrics |
The DF Margin commands set the margins of your document using the current metrics, specified by the value of dfCurrent_metrics in the WinPrint Global Object. The default metrics is centimeters and all margins are set to 2.53cm as default. 2.53cm equals 1inch. You cannot set the margins for individual pages. The margins you have set will be valid for all pages of the report.
You can set all margins at one time by calling the procedure DFSetMargins in the printer object and passing the values for left, top, right, and bottom in that order.
DFTopMargin 1.25
DFBottomMargin 1.25
Send DFSetMargins of WinprintId nLeft nTop nRight nBottom
Send DFSetMargins of WinprintId 2 1.25 2 1.25
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
Purpose DFWrite appends data to the current line Syntax 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 attribute(s) (WinPrint named constants) | |
| decimal_places | integer Optional. Number of digits to the right of the decimal for numeric values |
If you use decimal_places, you must use all preceding arguments. If you use this argument, the output will be displayed with the number of decimal digits specified, right-justified to the page/header.
If you use FONT_LEFT, FONT_CENTER or FONT_RIGHT in attributes, the output will be justified to the page/header.
DFWrite "Balance" (FONT_ITALIC +FONT_BOLD +RGB_RED)
DFWrite product.description (FONT_DEFAULT)
DFWrite 12345.67 (FONT_ITALIC +RGB_BLUE) 2
DFWriteBMP
Purpose DFWriteBMP is used to place a bitmap on the page. Syntax DFWriteBMP {path\filename} {vert_Location} {horz_Location} {height} {width} [{update_cur_pos}]
| Argument | Type | Explanation | Constant | Meaning |
|---|---|---|---|---|
| path\filename | string Name and path of bitmap file | |||
| 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 placedConstantMeaning | |||
| DFGR_SETPOS | Move current position to end of bitmap | |||
| DFGR_NOPOS | Leave current position unchanged |
Path is only required if the bitmap is not in the same directory as the application.
The vertical and horizontal start positions use current metrics for the position on the page. Height and width of the bitmap also use current metrics.
Position is from the margin.
DFWriteBMP 'UGLYFACE.BMP' 2 10 4 3 DFGR_NOPOS
DFWriteCol
Purpose DFWriteCol appends data to the current line at the specified column. Syntax DFWriteCol {variable} {column} [{attributes} [{decimal-places}]]
| Argument | Type | Explanation |
|---|---|---|
| variable | string A literal, variable, or database field whose value is to be output | |
| column | integer Column to write to | |
| attributes | constant Optional. Font attribute(s) (WinPrint named constants) | |
| decimal_places | integer Optional. Number of digits to the right of the decimal for numeric values |
The number of columns on the page is specified by Procedure DFNew_page (0 is legal). Columns are numbered ordinally from left to right starting with 1. They are a convenience not only for coding, but for freeing much code of sensitivity to the current metrics setting.
If you use decimal_places, you must use all preceding arguments. If you use this argument, the output will be displayed with the number of decimal digits specified, right-justified in the column.
If you use FONT_LEFT, FONT_CENTER or FONT_RIGHT in attributes, the output will be justified to the column.
DFWriteCol "String to print" 0 (FONT_ITALIC+FONT_BOLD +RGB_RED)
DFWriteCol Database.Field 1 (FONT_DEFAULT)
DFWriteCol 12345.67 2 (FONT_ITALIC +RGB_BLUE) 2
DFWriteDiagram
Purpose DFWriteDiagram is used to position a diagram created with DFCreateDiagram on the page. Syntax DFWriteDiagram {vert} {horz}
| Argument | Type | Explanation |
|---|---|---|
| vert | number Location (upper-left corner) vertical coordinate in the current metrics | |
| horz | number Location (upper-left corner) horizontal coordinate in the current metrics |
DFWriteDiagram uses the current diagram ID. If you nest diagrams, it is up to you to maintain the desired diagram ID.
DFWriteDiagram DFGR_CURRLINE 5
DFWriteDiagram 4 6
DFWriteEllip
Purpose DFWriteEllip writes an ellipse to the page. Syntax DFWriteEllip {vert} {horz} {height} {width} [{border_color} [{border-width} [{reprint} [{fill_color} [{update_cur_pos}]]]]]
| Argument | Type | Explanation | Constant | Meaning | Constant | Meaning |
|---|---|---|---|---|---|---|
| vert | number Location (upper-left corner) vertical coordinate in the current metrics | |||||
| horz | number Location (upper-left corner) horizontal coordinate in the current metrics | |||||
| height | number Height of the ellipse in the current metrics | |||||
| width | number Width of the ellipse in the current metrics | |||||
| 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 pageConstantMeaning | |||||
| DFGR_NOWRAP | Print once only | |||||
| DFGR_WRAP | Print on each succeeding page | |||||
| fill_color | constant Optional. Fill color (default transparent) | |||||
| update_cur_pos | constant Optional. Determines where current position pointer will be placedConstantMeaning | |||||
| DFGR_SETPOS | Move current position to end of ellipse | |||||
| DFGR_NOPOS | Leave current position unchanged |
Many of the arguments can be named constants. DFGR_RB_MARGIN refers to the full distance between the top and bottom margins or the left and right margins, as appropriate.
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
Purpose DFWriteLine is used to output a graphic line (rule) to a page. Syntax DFWriteLine {vert} {horz} {length} [{orientation} [{color} [{width} [{update_cur_pos}]]]]
| Argument | Type | Explanation | Constant | Meaning | Constant | Meaning |
|---|---|---|---|---|---|---|
| vert | number Location (upper or left end) vertical coordinate in the current metrics | |||||
| horz | number Location (upper or left end) horizontal coordinate in the current metrics | |||||
| length | number Length of line in the current metrics | |||||
| orientation | constant Optional. Determines if line is horizontal of vertical.ConstantMeaning | |||||
| DFGR_HORI | Horizontal line (default) | |||||
| DFGR_NOPOS | Vertical line | |||||
| 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 placedConstantMeaning | |||||
| DFGR_SETPOS | Move current position to end of line | |||||
| DFGR_NOPOS | Leave current position unchanged |
DFWriteLine, which is not the same as DFWriteLn, is used to output a line (rule) to a page.
Many of the arguments can be named constants. DFGR_HORI (the default) provides for a horizontal line, while DFGR_VERT provides for a vertical one. DFGR_RB_MARGIN refers to the full distance the top and bottom margins or the left and right margins, as appropriate.
DFWriteLine 2 4 6 DFGR_HORI RGB_RED 0.1 DFGR_NOPOS
DFWriteLine DFGR_CURRLINE 3 DFGR_RB_MARGIN DFGR_VERT
DFWriteLn
Purpose DFWriteLn writes data to the current output line and begins a new output line. Syntax DFWriteLn {variable} [{attributes} [{decimal-places}]]
| Argument | Type | Explanation |
|---|---|---|
| variable | A literal, variable, or database field whose value is to be output | |
| attributes | Font attribute(s) (WinPrint named constants) | |
| decimal_places | Optional. Number of digits to the right of the decimal for numeric values |
If you use decimal_places, you must use all three arguments. If you use this argument, the output will be displayed with the number of decimal digits specified, right-justified to the page/header.
If you use FONT_LEFT, FONT_CENTER or FONT_RIGHT in attributes, the output will be justified to the page/header.
DFWriteln "End of report" (FONT_ITALIC +FONT_BOLD +RGB_RED)
DFWriteln visitors.id (FONT_DEFAULT)
DFWriteln 12345.67 (FONT_ITALIC +RGB_BLUE) 2
DFWriteLnCol
Purpose DFWriteLnCol writes the data to the specified column and begins a new output line. Syntax DFWriteLnCol {variable} {column} [{attributes} [{decimal-places}]]
| Argument | Type | Explanation |
|---|---|---|
| variable | string A literal, variable, or database field whose value is to be output | |
| column | integer Column to write to | |
| attributes | constant Optional. Font attribute(s) (WinPrint named constants) | |
| decimal_places | integer Optional. Number of digits to the right of the decimal for numeric values. |
DFWritePos writes the data to the specified column and does a line feed. The number of columns on the page is specified by Procedure DFNew_page (0 is legal). Columns are numbered ordinally from left to right starting with 1. They are a convenience not only for coding, but for freeing much code of sensitivity to the current metrics setting.
If you use decimal_places, you must use all preceding arguments. If you use this argument, the output will be displayed with the number of decimal digits specified, right-justified in the column.
If you use FONT_LEFT, FONT_CENTER or FONT_RIGHT in attributes, the output will be justified to the column.
DFWritelnCol "String to print" 0 (FONT_ITALIC +FONT_BOLD +RGB_RED)
DFWritelnCol Database.Field 1 (FONT_DEFAULT)
DFWritelnCol 12345.67 2 (FONT_ITALIC +RGB_BLUE) 2
| Col 1 | Col 2 |
|---|---|
| Note: | DFWriteCol and DFWriteLnCol cannot be used inside header sections. |
DFWriteLnPos
Purpose DFWriteLnPos appends data to the current line at a specified position from the left margin and begins a new output line. Syntax 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 attribute(s) (WinPrint named constants) | |
| 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 appends data to the current line at a specified position from the left margin using the current metrics, specified by the value of dfCurrent_metrics in the WinPrint Global Object, and opens the next new line at the left margin.
If you use decimal_places, you must use all preceding arguments. If you use this argument, the output will be displayed with the number of decimal digits specified, right-justified to the position. When using decimals, set the position for the right side of the data.
MaxLength is an optional parameter and if not passed the entire output value will be output. Passing a length of zero (0) will also output the entire string. If you wish to pass the MaxLength parameter you must also pass parameters for Attributes and Decimal_places. Pass -1 for no-decimal places (i.e., a string output). The following commands are the same:
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
Purpose DFWritePos appends data to the current line at a specified position from the left margin. Syntax 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 attribute(s) (WinPrint named constants) | |
| 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 appends data to the current line at a specified position from the left margin using the current metrics, specified by the value of dfCurrent_metrics in theWinPrint Global Object.
If you use decimal_places, you must use all preceding arguments. If you use this argument, the output will be displayed with the number of decimal digits specified, right-justified to the position. When using decimals, set the position for the right side of the data.
MaxLength is an optional parameter and if not passed the entire output value will be output. Passing a length of zero (0) will also output the entire string. If you wish to pass the MaxLength parameter you must also pass parameters for Attributes and Decimal_places. Pass -1 for no-decimal places (i.e., a string output). The following commands are the same:
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
Purpose DFWriteRect is used to write a rectangle to the page. DFWriteRect is very useful to place borders around section headers and/or footers. Syntax DFWriteRect {vert} {horz} {height} {width} [{line_color} [{line_width} [{reprint} [{fill_color} [{update_cur_pos}]]]]]
| Argument | Type | Explanation | Constant | Meaning | Constant | Meaning |
|---|---|---|---|---|---|---|
| vert | number Location (upper-left corner) vertical coordinate | |||||
| horz | number Location (upper-left corner) horizontal coordinate | |||||
| height | number Height of rectangle in the current metrics | |||||
| width | number Width of rectangle in the current metrics | |||||
| 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.ConstantMeaning | |||||
| DFGR_NOWRAP | Print once only | |||||
| DFGR_WRAP | Print on each succeeding page | |||||
| fill_color | constant Optional. Fill color (default transparent) | |||||
| update_cur_pos | constant Optional. Determines where current position pointer will be placedConstantMeaning | |||||
| DFGR_SETPOS | Move current position to end of rectangle | |||||
| DFGR_NOPOS | Leave current position unchanged |
Many of the arguments can be named constants. DFGR_RB_MARGIN refers to the full distance between the top and bottom margins or left and right margins, as appropriate.
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
Purpose DFWriteXYLine is used to place a line (rule) on the page from one point to another. Syntax DFWriteXYLine {vert} {horz} {vert_stop} {horz_stop} [{color} [{width} [{reprint} [{update_cur_pos}]]]]
| Argument | Type | Explanation | Constant | Meaning | Constant | Meaning |
|---|---|---|---|---|---|---|
| vert | number Start location vertical coordinate in the current metrics | |||||
| horz | number Start location horizontal coordinate in the current metrics | |||||
| vert_stop | number Stop location vertical coordinate in the current metrics | |||||
| horz_stop | number Stop location horizontal coordinate in the current metrics | |||||
| 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 pagesConstantMeaning | |||||
| DFGR_NOWRAP | Print once only | |||||
| DFGR_WRAP | Print on each succeeding page | |||||
| update_cur_pos | constant Optional. Determine how current line is affectedConstantMeaning | |||||
| DFGR_SETPOS | Move current position to end of line | |||||
| DFGR_NOPOS | Leave current position unchanged |
The line need not be either horizontal or vertical. You cannot use DFGR_CURRLINE with DFWriteXYLine.
Many of the arguments can be named constants. DFGR_RB_MARGIN refers to the full distance between the top and bottom margins or the left and right margins, as appropriate.
DFWriteXYLine 0 0 DFGR_RB_MARGIN DFGR_RB_MARGIN RGB_BLACK 0.1 DFGR_WRAP ;
DFGR_NOPOS
DFWriteXYLine 1 1 10 15 RGB_BLACK
Procedure_Section
This command defines the start of a procedure section. It is similar to the predecessor Report Macro's section command. The procedure_section command allows you to define a procedure section for your report (header, footer, subheader, body, etc). Since this is a windows report you do not use images as you would with BasicReport
Section_name must be one of the following keywords. Each of these is described above in the section on Procedures:
Page_Top Report_Header Page_Header Page_Title SubHeader_Init1..n SubHeader1..n Body SubTotal1..n Total Page_Total Page_Footer Report_Footer Page_Bottom
The procedure_section exists because it is defined in the BasicReport superclass which needs images. With the Winprint class you can use the Procedure_Section command or a procedure. We recommend you use the procedure. For example, these two examples are actually identical: Example 1
Procedure_Section SubHeader1
:
End_Procedure
Procedure_Section Body
:
End_Procedure
Example 2
Procedure SubHeader1
:
End_Procedure
Procedure Body
:
End_Procedure
Report_Breaks
This command defines the breakpoints needed in a report and is the same as using the break parameter in the report object-creation statement. The report_breaks command is the more-flexible approach because it may be used in class construction. In addition, when using the break parameter, you cannot define a break that is a function local to the report object you are creating. This doesn't work:
Object aReport is a basicReport Break (aFunction(self))
This does work:
Object R is a basicReport
Report_Breaks (F(self)
The breakpoints can be just about anything. They can be a file.field (as in the Report Macro), they can be a variable or a window, or they can be a built-in or a user-defined function.
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 basicReport subclass should be created using the various report_???? commands.
Class V_Report is a BasicReport
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
This command determines which DDO will serve this report object. It does this by setting the server property to the DDO's object ID. The server property may also be set in the report object's creation statement with the using option, or it may be set by setting the server property.
The following examples are all identical:
Object oVndrReport is a BasicReport Using Vndr_DD
Object oVndrReport is a BasicReport
Report_Data_Set Vndr_DD
Object oVndrReport is a BasicReport
Set Server to Vndr_DD
Report_Index
This command sets the index of the main_file to be used by the report and the direction the index should be traversed. It does this by setting two properties: ordering and find_down_state. This may also be accomplished by placing this command's parameters in the report-object-creation statement, or by directly setting the properties.
The report_index command is the most-flexible approach because it can be used inside of class construction and it can used with either an index number or with a file.field whose main index should be used. Examples
Report_Index BY 2
Report_Index DOWN Vndr.Name
Report_Index BY IntVar
If the report_index command is used in a class, remember that it must be placed inside a procedure or function (most likely Procedure construct_object). Also note that this command (and the associated properties) may be used and changed at runtime.
Report_Main_File
This command determines the main file for a report. It does this by simply setting the main_file property to the df_filename's filenumber. This property may also be set by the report object's creation statement with the main_file file_name option, or it may be set by setting the main_file property.
The following examples are all identical:
Object oVndrReport is a BasicReport Main_File Vndr
Object oVndrReport is a BasicReport
Report_Main_File Vndr
Object oVndrReport is a BasicReport
Set Main_File to Vndr.File_number
The report_main_file command (or setting the main_file property) are more flexible than the command-line main_file option because they can be used in both object and class definitions.
If the report_main_file command (or a set main_file ... statement) are used in a class, remember that it must be placed inside a procedure or function (most likely Procedure construct_object). Also note that the main_file property may be set and changed at runtime.
Zero_Subtotals
This object does not zero sub-totals before a report is run. This means that if you cancel a report in the middle and restart without leaving the program, the subtotals may be wrong. Zero_subtotals zeros the subtotal accumulators of all image windows named. This command should be executed as part of a report's initialization, possibly in the starting_report function. It is a good idea to zero the subtotal accumulators of any image that uses a subtotal. You can find all subtotals by doing a search of your program for all subtotal commands.
Function Starting_Report Returns Integer
Zero_SubTotals SubTotal2.2 SubTotal2.3 SubTotal1.2
Zero_SubTotals VndrTotal VndrDue VndrPaid
End_Function