SHOWDOCUMENT()

From Lianjapedia
Revision as of 10:09, 4 February 2013 by Helen.george (Talk | contribs)

Jump to: navigation, search

Purpose

Function to displays a document in its associated plugin/application

Syntax

SHOWDOCUMENT(<expC1>[, <expC2>[, <expC3>]])

See Also

GETFILE()

Description

The SHOWDOCUMENT() function displays a document in its associated plugin/application.

Parameter Description
<expC1> A URL or the name of a file.
<expC2> The target frame for browser based URLs. If omitted the document is loaded into a new browser window. Ignored for non-browser based URLs. Required if <expC3> is specified.
<expC3> A templatefile for use with XML or XLS files. This is a text file containing comma separated data that is loaded into the XML or XLS file specified in <expC1>.

If <expC1> specifies an Excel spreadsheet file additional options can be included as arguments. The arguments follow the XLS file name and are preceded by a '?'. For further configuration, directives may be included in the template file.

Example

// Accessing local files using '.pdf' and '.doc' file associations
showdocument("file://C:Documents and SettingsAll UsersDocumentsAcrobat.pdf")
showdocument("file://C:Documents and SettingsAll UsersDocumentsWordDoc.doc")
 
// Remote ftp URL
showdocument("ftp://ftp.recital.com/LianjaUpdate-Win.exe")
 
// Remote http URL
showdocument("http://www.recital.com", "_top")
 
// Loading a template of comma-separated text into an XML file
// and then displaying the XML file
showdocument("file://C:Customers.xml", "_blank", "custdata.txt")
 
// Example to download an Excel file, load comma delimited data into it
// and then display it on the client in Microsoft Excel
open database southwind
use suppliers
copy to datafile&(getpid()).txt type delimited
showDocument("myExcelReport.xls?command=create;row=4;col=2", "_blank", "datafile&(getpid()).txt")
 
// Example to create an HTML file on the server and
// then invoke the browser on the client to display it
fp = fcreate("htmlfile&(getpid()).htm")
fwrite(fp, "<html>")
fwrite(fp, "<body>")
fwrite(fp, "<table>")
fwrite(fp, "<tr>")
fwrite(fp, "<td>Field1</td>")
fwrite(fp, "<td>Field2</td>")
fwrite(fp, "</tr>")
fwrite(fp, "</table>")
fwrite(fp, "</body>")
fwrite(fp, "</html>")
fclose(fp)
showDocument("htmlfile&(getpid()).htm")