SHOWDOCUMENT()

From Recital Documentation Wiki
Revision as of 16:17, 28 October 2009 by Helengeorge (Talk | contribs)

Jump to: navigation, search

Purpose

Function to open a URL or a server-based file on a Mirage client


Syntax

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


See Also

COPYFILEFROM(), COPYFILETO()


Description

The SHOWDOCUMENT() function is used to open a URL or server-based file on a Mirage client. For server files or file:// URLs, the file can be of any type with a Windows file association on the client. For browser based URLs, the target frame can also be specified. For XML or XLS (Microsoft Excel) files, data can be dynamically loaded from a specified text file.


Parameter Description
<expC1> A URL or the name of a file on the server.
<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. Please see the Mirage documentation for full details on the available option arguments and directives.


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/RecitalUpdate-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")


Products

Recital Mirage Server