Skip to main content
Version: 7.9

system.dataset.dataSetToHTML

This function is used in Python Scripting.

Description

Formats the contents of a dataset as an HTML page, returning the results as a string. Uses the < table > element to create a data table page.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.dataset.dataSetToHTML(showHeaders, dataset, title)

Parameters

TypeParameterDescription
BooleanshowHeadersIf True (1), the spreadsheet will include a header row.
DatasetdatasetsThe dataset to export
StringtitleThe title for the HTML page.

Returns

String - The HTML page as a string.

Scope

All

Code Examples

Example 1
# This snippet would run a SQL query against a database, and turn the results into a string containing HTML. It then writes the string to a file on the local hard drive.

results = system.db.runQuery("SELECT * FROM example1 LIMIT 100")
results = system.dataset.toDataSet(results)
html = system.dataset.dataSetToHTML(1, results, "Production Report")
filePath = "C:\\output\\results.html"
system.file.writeFile(filePath, html)