This method allows easy display of an entire table, simply by having a table or cursor selected and calling this method. You can optionally pass an array of headers as well as a title and the option to automatically sum all numeric fields.
oHTML.ShowCursor(@aHeaders, cTitle, lSumNumbers, lNoOutput,cTableTags)
Parameters
@aHeaders
An array that should contain as many text headers as they are columns in the table/cursor to display. If this parameter is not passed the field names are used as column headers.The header names may be followed by a colon followed by a number indicating the width of the header to override the field width which is used by default.
Ctitle
Title text to display above the headers.
lSumNumbers
Flag that allows automatic summing of all numeric fields in the table to display. The total is displayed at the bottom of the display below the appropriate numeric fields.
LNoOutput
When set to .T. output is not sent to file, instead returning the result as a string.
cTableTags
Allows adding additional table tags to the table display to control the appearance of the HTML table. For example, you could pass "WIDTH=100% BORDER=5" to force the table to be full size. The default value is "WIDTH=90%".
Remarks
By default an HTML table is used for output unless output size exceeds MAX_TABLE_CELLS (in WCONNECT.H) . When this number is exceeded ShowCursor reverts to a <pre> list display which can render much faster. The default size for MAX_TABLE_CELLS is 4000 cells.
This is a simple high level method. If you want more control please use the wwShowCursor class.
For better performance you should hand-code your tables with the Write() method. Hand coding can cut request times for large table requests by more than half.
Example
SELECT company, lname ; FROM TT_Cust ; INTO CURSOR Tquery *** Basic oHTML.ShowCursor() *** Using custom headers DIMENSION laHeader[2] laHeader[1]="Company" laHeader[2]="Last Name" oHTML.ShowCursor(@laHeaders,"Client List")
See also:
Class wwResponse | Class wwShowCursor© West Wind Technologies, 1996-2024 • Updated: 04/03/00
Comment or report problem with topic