ReportView Control

 

The REPORTVIEW control is a ListView common control with the 'report' Windows style.  It can be used as either a simple grid control when a full featured grid control is not needed or as an advanced version of the WIL dialog ITEMBOX control.

Return Value:

The REPORTVIEW control will return the users selection in the Variable you supply as the Variable attribute in the controls definition. The Variable will contain an array of user selected rows from the control on a non-canceling exit from the dialog

Control Definition:

 

<dlg-variable>nn =`x, y, width, height, type, control-name, variable, text/csv file, value, tab-order, style, font, textcolor, backgroundcolor`

 

For Example:

MyDialog003=`005,005,174,114,REPORTVIEW,"ReportView_1",rvVariable1,DEFAULT,DEFAULT,30,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

 

Attribute

Value

Meaning

dlg-variable

MyDialog

The name of the dialog box.

nn 

003

The ordinal position of the control in the dialog box (starting with 1).

x

005

The horizontal coordinate of the upper left corner of the control in Dialog Units.

y

005

The vertical coordinate of the upper left corner of the control in Dialog Units.

width

174

The width of the control in Dialog Units

height

114

The height of the control in Dialog Units.

type 

REPORTVIEW

The type of control.

control-name

"ReportView_1"

The name used to identify the control in a user defined callback procedure. The name cannot be more than 30 characters in length and MUST be unique. ( This attribute can only be used with 6.2 or later dialog formats. )

variable

rvVariable1

The name of the variable affected by the control.

The name of a variable that receives an array of user selected rows from the control on a non-canceling exit from the dialog.  Optionally, the variable can contain an array or WIL map  of values to display in the control. When the variable is used to populate the control, the control will have a column for each column in the array.  The array can optionally contain text for each column heading in the first row of the array when the control has the @csFirstHeader style. However, the @csFirstHeader style is ignored when a WIL map is used as the contents source. See the style attribute for details. Note that the array variable contents will only be used to populate the control when the 'text' control definition attribute is set to 'DEFAULT'. Supports variant safe arrays.

text / CSV file

DEFAULT

or

"c:\data.csv"

The 'text' can either be set to 'DEFAULT' or set to the path and file name of a CSV file used to populate the control. The file must meet the same CSV file requirements specified for the ArrayFileGetCsv function and the value separator must be a comma(,).   The first line of the file can optionally contain column headings.  See the style attribute for details.

value

DEFAULT

Not applicable to this control.

tab-order

30

Allows you to specify a control's tab order independently of a control's position or name in the dialog template. Tab-order controls the order in which controls are accessed when the keyboard is used to navigate the dialog. It also influences which control is on top when controls have overlapping positions in the dialog. It can be any positive integer, but each control should have a unique number.

When you navigate through a dialog using the tab key, lower number controls will be given the keyboard focus before higher controls. Likewise, low-numbered overlapping controls will appear on top of higher numbered controls. If you specify the DEFAULT keyword for this attribute or if you give two controls the same tab order, a tab order will be arbitrarily assigned to the control.

Note: The dialog function, under certain circumstances, may change the tab order you specify. The GROUPBOX controls tab order may be adjusted so that it is smaller than any of the controls it contains. In addition, the tab order of the controls inside the GROUPBOX may be adjusted so that they are consecutive.

style 

DEFAULT

Allows you to control the initial appearance and behavior of your control. Numbers represent each style and they can be combined, using the bit-wise OR (|) operator, to set multiple styles. The following table lists the style numbers, their meanings, and the controls that they have an effect on.

Style

Meaning

@csInvisible (1)

Control is invisible

@csDisabled (2)

Control has disabled appearance and does not accept any user input, it would otherwise accept input.

@csNoHeader (524288)

The header bar is not displayed across the top of the control.

@csFirstHeader (1048576)

The first row of the source array or file is treated as column header text.  This style is ignored when a WIL map is used as the contents source.

@csGrid (2097152)

The control displays vertical and horizontal lines to form a grid.

@csSingleSel (4194304)

Only one row can be selected at a time.

@csFullSel (8388608)

Selection highlighting extends to all sub items in the selected row.

@csAsort (16777216)

(sort ascending) The control is populated with rows ordered from lowest to highest first column values. Sorts using an "intuitive" sort (See ArraySort for details). The user can reorder control rows based on any column's values by clicking on the column header.

@csDsort (33554432)

(sort descending) The control is populated with rows ordered from highest to lowest first column values. Sorts using an "intuitive" sort (See ArraySort for details). The user can reorder control rows based on any column's values by clicking on the column header.

@csColEdit (67108864)

The first column text can be edited in place.

@csColCheck (134217728)

Enables check boxes for each first column item in the control.

@csIncHeader (268435456)

Causes the column header text to be included when the control's contents are save to file or array.

@csLogSort (1073741824)

(logical sort) The control is populated with rows ordered from lowest to highest first column values. Sorts using a case-insensitive logical sort (See ArraySort for details).  The user can reorder control rows based on any column's values by clicking on the column header. The logical sort order can be change to a high to low sort by using the @csDsort style  with the @csLogSort style.

Note: Specifying 0 for this attribute is equivalent to using the DEFAULT keyword and means that the control will exhibit default behavior.

font 

DEFAULT

The font used to display a control's text. The font description should be delimited by double quote (") marks unless the attribute is set to DEFAULT. If this attribute is set to DEFAULT, the font specified as the value of the main dialog font will be used. If the main dialog font is set to DEFAULT, the system font is used. You do not need to provide any value for this attribute unless you are also specifying text or background color. For details see the Dialog Fonts topic. WARNING: If a font is selected that doesn't exist on the user's system, a substitution will be made. We recommend using commonly available fonts.

textcolor 

DEFAULT

The color of text associated with a control. Color is specified by three vertical bar (|) delimited numbers ranging from 0 to 255 or a single hexadecimal number preceded by the letter 'h'. The numbers represent one of the RGB colors: red, green or blue, in that order. The complete color specification must be surrounded by double quotes (") unless the DEFAULT key word is used. If this attribute is set to DEFAULT, the color listed in the main dialog's textcolor will be used. If a color is not specified for the dialog, the system text color will be used.

backgroundcolor 

DEFAULT

Used to change the color displayed behind a controls text. Color is specified by three vertical bar (|) delimited numbers ranging from 0 to 255 or a single hexadecimal number preceded by the letter 'h'. The numbers represent one of the RGB colors (red, green or blue, in that order). The complete color specification must be surrounded by double quotes (") unless the DEFAULT keyword is used. If no color is specified or the DEFAULT keyword is used the system background color will be used.

 

Event Options

Use the DialogProcOptions function to control when your User-Defined-Callback procedure is called by its associated dialog. You can also use it to control your dialog's behavior, while your procedure is executing. You usually establish callback events during the first call to the procedure i.e., event 0, but this can be done during any call.

Event-Option-Code Values

Meaning

@deRvrSelect (18)

Item Select Row: User has selected row in the REPORTVIEW control. The text of the first column of the selected row is passed to the callback UDF/UDS in the callback's fifth parameter.

Note:This event will only trigger if the user clicks on the first column. If you want to select anywhere on the row, you need to use the full row select style.

@deRvrDblclick (19)

Double-Clicked Row: User has used the mouse to double-click a row in the REPORTVIEW control. The text of the double-clicked column of the double-clicked row (or the first column of the row when style @csFullSel is used) is  passed to the callback UDF/UDS in the callback's fifth parameter.

@deRviCheck (20)

Checked/Unchecked Item: User has checked or unchecked an item in a REPORTVIEW control with the 'checkbox' style.  The text of the checked item is passed to the callback UDF/UDS in the callback's fifth parameter.

@deRviText (21)

Item Text: User has changed the text of a first column item in a REPORTVIEW control. The user modified text of the item is passed to the callback UDF/UDS in the callback's fifth parameter. Note that if more than one first column item of a control contains the same value, it is possible for the fifth parameter to contain a tab delimited list of multiple occurrences of the targeted item's text. The number items in the list indicates which instance of the item is the target of the event.

@deRvhClick (22)

Column Click: User has used the mouse to click a column header of a REPORTVIEW control. The one based column number of the clicked column is passed to the callback UDF/UDS in the callback's fifth parameter. The event is fired before the indicated column is sorted so the sort direction can be controlled by setting or changing the sort direction style of the control during the callback. Sorting is effectively cancelled by removing both sorting related styles from the control.

 

 

 

 

Dialog Callback Procedure Function Options

DialogControlGet function returns text and state information associated with a control.

Request

Meaning

@dcCheck (1)

1 if the REPORTVIEW control has the checkbox (@csColCheck) style and the indicated item is checked, 0 for unchecked. The functions optional fourth parameter (request-value)  must be used to indicate the text of the item to test.

@dcContents (5)

One or two dimension array containing the contents of a REPORTVIEW control. Supports variant safe arrays.

@dcSelect (6)

One or two dimension array containing all selected rows of a REPORTVIEW control. Supports variant safe arrays.

@dcBackColor (11)

Background color specified by three vertical bar (|) delimited numbers ranging from 0 to 255. If the control is using the system default color, the string "DEFAULT" is returned.

@dcTextColor (13)

Text color specified by three vertical bar (|) delimited numbers ranging from 0 to 255. If the control is using the dialog's default text color, the string "DEFAULT" is returned.

@dcPosition  (17)

Space delimited list of a control's position and size in dialog units relative to the dialog's client area. The first two numbers are the horizontal and vertical location of the upper-left corner of the control while the third and fourth numbers are the width and height of the control.

@dcMenuNames (18)

Tab delimited list of menu item names associated with the control, menu item or menu bar.

@dchWnd (19)

Window handle of a dialog control.

@dcHeaderText (20)

Tab delimited list of REPORTVIEW column headings.

@dcColWidth (21)

Space delimited list of the width of each REPORTVIEW column in dialog units.

@dcFind (24)

One or two dimension array containing all REPORTVIEW rows which have first column text matching one of the items specified as a tab delimited list in the functions fourth parameter (request-value) .

@dcCancelEdit (25)

1 if the next user edit of an item will be canceled upon completion. This request code only applies to REPORTVIEW controls with the edititem (@csColEdit) style.

@dcGetChecked (26)

One or two dimension array containing all checked rows of a REPORTVIEW control. This request code is only relevant when a REPORTVIEW control has the checkbox(@csColCheck) style.

@dcColFormat (27)

Space delimited list of format specification for each REPORTVIEW column. The returned values have the following meanings:

0 - left justify text

1 - center justify text

2 - right justify text

@dcItemColor (29)

Returns a space delimited list containing two color descriptors representing the colors of a REPORTVIEW control item's text and background color.  Each color descriptor consists of 3 vertical bar(|) delimited numbers representing red, green, and blue values each ranging from 0 to 255. The functions optional "request-value" parameter  must be used to indicate the one-based row and column number of the REPORTVIEW item whose colors are to be returned.  The row and column numbers must be separated by a space.

@dcItemRow (30)

Returns the one-based row number of column 1, the left-most column, REPORTVIEW item with text that matches the text placed in the function's "request-value"  parameter.

Note that if more than one first column item of a control contains the same value, the  text may need to contain a tab-delimited (@Tab)  list indicating which occurrences of the item to return

@dcItemText (31)

Returns the column 1, the left-most column, text of the one-based  REPORTVIEW row indicated in the function's "request-value"  parameter.

Note that if more than one first column item of a control contains the same value, the returned text may contain a tab-delimited (@Tab) list of multiple occurrences of the targeted item's text.

 

DialogControlSet function changes the text or appearance of a control.  

Request

Meaning

@dcCheck (1)

Checks or unchecks an item in a REPORTVIEW control. Use the function's set-info (fourth) parameter to indicate the first column text of the row to check or uncheck.  The text can be a delimited list to indicate which row should be checked or unchecked when multiple rows have the same first column text.

@dcContents (5)

Replaces the contents of the REPORTVIEW control.  The function's fourth parameter must contain either a CSV file path+name, or a one or two dimension array or a WIL map that will be used to replace the existing contents of the control. Supports variant safe arrays.  Note that the @csFirstHeader style is ignored when a WIL map is used as the contents source.

@dcSelect (6)

Toggles the selection state of a row in a REPORTVIEW control. Use the function's set-info (fourth) parameter to indicate the first column text of the row to select or unselect.  The text can be a delimited list to indicate which row should be selected when multiple rows have the same first column text. Use an empty string to unselect all selected rows of a control. Note that the control automatically unselects a selected row when a new row is  selected when the control has the singleselect (@csSingleSel) style.

@dcScroll (10)

Scrolls a REPORTVIEW control row into view. Use the function's set-info (fourth) parameter to indicate the first column text of the row to scroll into view.  

@dcBackColor (11)

Background color. The color is specified by three vertical bar (|) delimited numbers ranging from 0 to 255 or a single hexadecimal number preceded by the letter 'h'. To give the control the system default background color, use an empty string ""or the "DEFAULT "key string for this parameter.

@dcTextColor (13)

Text color. The color is specified by three vertical bar (|) delimited numbers ranging from 0 to 255 or a single hexadecimal number preceded by the letter 'h'.  To give the control the dialog's default text color, use an empty string ""or the "DEFAULT "key string for this parameter

@dcAddItem (14)

Adds a row to a REPORTVIEW control.  The functions function's set-info (fourth) parameter can be an array or delimited list.  If the delimited list lacks enough items or the array enough columns the remaining columns of the control will be left empty.  If either the list or array has too many items or columns, the extra text will be ignored. If an array parameter contains multiple rows, all array rows will be added to the control. Supports variant safe arrays.

@dcRemItem (15)

Removes a row from a REPORTVIEW control. Use the function's set-info (fourth) parameter to indicate the first column text of the row to remove.  The text can be a delimited list to indicate which row to remove when multiple rows have the same first column text.

@dcPosition (17)

 

Space delimited list of a control's position and size in dialog units relative to the dialog's client area. The first two numbers are the horizontal and vertical location of the upper-left corner of the control while the third and fourth numbers are the width and height of the control.

@dcHeaderText (20)

Changes the column headings text of a REPORTVIEW control. Place a tab delimited list of the new column headings, one for each column, in the function's set-info (fourth) parameter.

@dcColWidth (21)

Specify a new width in dialog units or percent of the total control width for each REPORTVIEW column as a space delimited list in the function's set-info (fourth) parameter. Column widths can be set to -1 to cause a column's width to fit the column contents. -2 can be used to set a column's width to match the column's header text. Setting the farthest right column to -2 causes that column to fill the remaining width of the control. Use double percent signs(%%) immediately after a number to indicate that a number represents a percent of the total control width.

@dcAppendCol (22)

Adds a new column to the far right side of a REPORTVIEW control.  Indicate the columns header text in the functions set-info (fourth) parameter.

@dcRemoveCol (23)

Remove a column from a REPORTVIEW control.  The function set-info parameter should contain one based number from left to right of the column to remove.  Note that column 1, the left most column, cannot be removed from the control.

@dcCancelEdit (25)

 

Toggles canceling of a pending or the next edit of a REPORTVIEW control item.  The set-info parameter should be @True to turn on edit canceling and @False to turn off canceling. The function returns the previous edit cancel setting.

@dcColFormat (27)

(s) Specify the format for each REPORTVIEW column as a space delimited in the function's set-info parameter. Valid values and meanings:

0 - left justify text

1 - center justify text

2 - right justify text

 

@dcItemColor (29)

Sets the text and background colors of a REPORVIEW control item.  The item and colors are indicated by placing a space delimited- list in the functions's set-info parameter. The 4 items consist of the one-based row number and one-based column number followed by the text color descriptor and background color descriptors.  The two color descriptors consist of 3 vertical bar(|) delimited numbers representing the color's red, green, and blue values each ranging from 0 to 255 or a single hexadecimal number preceded by the letter 'h'.  

Three row values have special meaning:

-1 - add colors to the column of each odd-numbered row
-2 - add colors to the column of each even-nummberd row
-3 - add colors to the column of all row

One Column value has special meaning:

-1 - add colors to all columns of the row

 

@dcItemText (31)

Sets the text of a REPORTVIEW control item o sub-item. The row number, column number (sub-item), and replacement text should be place in space delimited list in the function's set-info parameter. For example, the space delimited list

"1 1 WinBatch"

would replace the text in the first column of the first row with the word "WinBatch".

Note: row and column numbers are one based and this request cannot be used to add a new row or column to the control.

 

 

Note that the above functions apply case insensitive text comparisons when identifying items in a REPORTVIEW control.

 

DialogControlState function changes a control’s style or gives control input focus.

Style

Meaning

@csInvisible (1)

Control is invisible

@csDisabled (2)

Control has disabled appearance and does not accept any user input, it would otherwise accept input.

@csNoHeader (524288)

The header bar is not displayed across the top of the control.

@csFirstHeader(1048576)

The first row of the source array or file is treated as column header text.

@csGrid (2097152)

The control displays vertical and horizontal lines to form a grid.

@csSingleSel (4194304)

Only one row can be selected at a time.

@csFullSel (8388608)

Selection highlighting extends to all sub items in the selected row.

@csAsort (16777216)

(sort ascending) The control is populated with rows ordered from lowest to highest first column values. Sorts using an "intuitive" sort (See ArraySort for details). The user can reorder control rows based on any column's values by clicking on the column header.

@csDsort (33554432)

(sort descending) The control is populated with rows ordered from highest to lowest first column values. Sorts using an "intuitive" sort (See ArraySort for details). The user can reorder control rows based on any column's values by clicking on the column header.

@csColEdit (67108864)

The first column text can be edited in place.

@csColCheck (134217728)

Enables check boxes for each first column item in the control.

@csIncHeader (268435456)

Causes the column header text to be included when the control's contents are save to file or array.

 

 

 

 

§         Dialog

§         Dialog Overview

§         Defining the Dialog

§         Defining the Dialog Controls

§         Dialog Control Types

§         Dynamic Dialogs

§         InternetExplorer Controls

§         Dialog Units

§         Dialog Fonts

 

Control Types

§         Calendar

§         Checkbox

§         ComControl

§         DropListbox

§         Editbox

§         FileListbox

§         Groupbox

§         Itembox

§         MenuBar

§         MenuItem

§         MultiLinebox

§         Picture

§         PictureButton

§         PushButton

§         RadioButton

§         ReportView

§         Spinner

§         StaticText

§         VaryText