Report View

 

The Report View 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.

The variable, defined in the controls Variable attribute, is assumed to contain an array 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. See the Style attribute for details. Note that the array variable contents will only be used to populate the control when the Text attribute is set to 'DEFAULT'. Upon return of the Dialog this variable will contain an array of user selected rows from the control.  

The Text attribute 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.

 The Style attribute supports the following styles:

 

Value

 Meaning

@csInvisible (1)

Invisible

@csDisabled (2)

Disable

@csNoHeader (524288)

noheader: The header bar is not display across the top of the control.

@csFirstHeader (1048576)

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

@csGrid (2097152)

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

@csSingleSel (4194304)

singleselect: Only one row can be selected at a time.

@csFullSel (8388608)

fullrowselect: Selection highlighting extends to all subitems in the selected row.

@csAsort (16777216)

sortascending:  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)

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

Note: if both sortascending and sortdecending are used, sortascending takes precedence.

@csColEdit (67108864)

edititem: The first column text can be edited in place.

@csColCheck (134217728)

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

@csIncHeader (268435456)

includeheader: Column header text is added as the first row of the array returned from an item search request, a selected or checked item request, or a request for all items of the control.  This style will also cause the control's associated variable to contain the column header text as the first row of the array referenced by the variable.

@LogSort(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.

268435456

columndrag: Enables drag-and-drop reordering of columns in the control.

 

To resize the Report view control, simply click on the edge and drag with the left mouse button.

 

DlgEdtr_ReportView.jpg

 

 

 

Control Attributes

 

Calendar

Check Box

Com Control

DateTime

Drop-down Combo Box

Edit Box

File List Box

Group Box

Item List Box

Menu Bar

Menu Item

Multiline Edit Box

Picture

Picture Button

Push Button

Radio Button

Report View

Spinner

Static Text

Variable Text

 

 

For example, the line in the script generated by the WIL Dialog Editor may look like:

Using an array as the Variable attribute:

 

Songs003=`017,031,108,048,REPORTVIEW,"ReportView_1",arrTunes,DEFAULT,DEFAULT,3,%style%,DEFAULT,DEFAULT,DEFAULT`

 

This example shows how to define the array to display:

 

;Create an array of data to display
arrTunes = ArrDimension(6,2)
; Artists
arrTunes[0,0] = 'Artist' ; Header
arrTunes[1,0] = 'The Knack'
arrTunes[2,0] = 'Glenn Miller'
arrTunes[3,0] = 'Bee Gees'
arrTunes[4,0] = 'B-52s'
arrTunes[5,0] = 'The Champs'
; Songs
arrTunes[0,1] =  'Song' ; Header
arrTunes[1,1] =  'My Shirona'
arrTunes[2,1] =  'In the Mood'
arrTunes[3,1] =  'Staying Alive'
arrTunes[4,1] =  'Rock Lobster'
arrTunes[5,1] =  'Tequila'

style = 1048576|4194304 ;first header & single select
SongsFormat=`WWWDLGED,6.2` SongsCaption=`Songs` SongsX=236 SongsY=124 SongsWidth=152 SongsHeight=109 SongsNumControls=004 SongsProcedure=`DEFAULT` SongsFont=`DEFAULT` SongsTextColor=`DEFAULT` SongsBackground=`DEFAULT,DEFAULT` SongsConfig=0
Songs001=`029,087,034,014,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Songs002=`071,087,034,014,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Songs003=`017,031,108,048,REPORTVIEW,"ReportView_1",arrTunes,DEFAULT,DEFAULT,3,%style%,DEFAULT,DEFAULT,DEFAULT` Songs004=`019,011,104,014,STATICTEXT,"StaticText_1",DEFAULT,"Choose your favorite song:",DEFAULT,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("Songs") Message("Your Favorite Song is:",arrTunes[0,0]:" - ":arrTunes[0,1])

Using a CSV as the Text attribute:

 

Songs003=`017,031,108,048,REPORTVIEW,"ReportView_1",arrTunesSelected,%filename%,DEFAULT,3,%style%,DEFAULT,DEFAULT,DEFAULT`

 

;Create an array of data to write to CSV file
arrTunes = ArrDimension(6,2)
; Artists
arrTunes[0,0] = 'Artist' ; Header
arrTunes[1,0] = 'The Knack'
arrTunes[2,0] = 'Glenn Miller'
arrTunes[3,0] = 'Bee Gees'
arrTunes[4,0] = 'B-52s'
arrTunes[5,0] = 'The Champs'
; Songs
arrTunes[0,1] =  'Song' ; Header
arrTunes[1,1] =  'My Shirona'
arrTunes[2,1] =  'In the Mood'
arrTunes[3,1] =  'Staying Alive'
arrTunes[4,1] =  'Rock Lobster'
arrTunes[5,1] =  'Tequila'

filename = DirScript():'Tunes.csv' ArrayFilePutCSV(filename, arrTunes)
style = 1048576|4194304 ;first header & singleselect
SongsFormat=`WWWDLGED,6.2` SongsCaption=`Songs` SongsX=236 SongsY=124 SongsWidth=152 SongsHeight=109 SongsNumControls=004 SongsProcedure=`DEFAULT` SongsFont=`DEFAULT` SongsTextColor=`DEFAULT` SongsBackground=`DEFAULT,DEFAULT` SongsConfig=0
Songs001=`029,087,034,014,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Songs002=`071,087,034,014,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` Songs003=`017,031,108,048,REPORTVIEW,"ReportView_1",arrTunesSelected,%filename%,DEFAULT,3,%style%,DEFAULT,DEFAULT,DEFAULT` Songs004=`019,011,104,014,STATICTEXT,"StaticText_1",DEFAULT,"Choose your favorite song:",DEFAULT,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("Songs")
Message("Your Favorite Song is:",arrTunesSelected[0,0]:" - ":arrTunesSelected[0,1])
 

The resulting Dialog containing the Report View control will look something like this:

 

reportview.jpg

 

Report View Control Behavior

 

See Also:

Item Listbox