FormatResultString method: Query class

Syntax

FormatResultString(&Rowset, Output_Format, StartRow, EndRow)

Description

Use the FormatResultString method to generate a string containing the content of the input (the rowset) in HTML, PDF, XLS, or CSV format. You can specify the range of rows to be in the rowset to be used as input. The rowset object is created using the RunToRowset method.

Parameters

Parameter Description

&Rowset

Specify an already instantiated and populated rowset object containing the query result. This rowset is created using the RunToRowset method.

Output_Format

Specify the format of the output. You can specify either a numeric or constant value. See below.

Start_Row

Specify the first row in the rowset that you want to use for output. This parameter takes a numeric value.

End_Row

Specify the last row in the rowset that you want to use for output. This parameter takes a numeric value.

The values for Output_Format can be as follows:

Numeric Value Constant Value Description

2

%Query_PDF

The output is in PDF format.

5

%Query_HTML

The output is in HTML format.

8

%Query_XLS

The output for Excel in HTML format.

14

%Query_TXT

The output for text in CSV format.

20

%Query_XML_XmlP

The output is in XMLP format.

Returns

A string containing the formatted output.

Example

/* Use RowCount, not ActiveRowCount, to get the total number of rows. */

&End = &MyRowset.RowCount;

&FormString = &MyQuery.FormatResultString(&MyRowset, %Query_TXT, 1, &End);