Difference between revisions of "SHOWDOCUMENT()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Function to open a URL or a server-based file on a Mirage client
+
Function to displays a document in its associated plugin/application
 
+
  
 
==Syntax==
 
==Syntax==
 
SHOWDOCUMENT(<expC1>[, <expC2>[, <expC3>]])
 
SHOWDOCUMENT(<expC1>[, <expC2>[, <expC3>]])
 
  
 
==See Also==
 
==See Also==
[[COPYFILEFROM()]], [[COPYFILETO()]]
+
[[GETFILE()]]
 
+
  
 
==Description==
 
==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.
+
The SHOWDOCUMENT() function displays a document in its associated plugin/application.
 
+
  
 
{| class="wikitable"
 
{| class="wikitable"
 
!Parameter||Description
 
!Parameter||Description
 
|-
 
|-
|<expC1>||A URL or the name of a file on the server.
+
|<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.
 
|<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.
Line 26: Line 22:
 
|}
 
|}
  
 
+
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.
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==
 
==Example==
Line 70: Line 64:
 
</code>
 
</code>
  
 
==Products==
 
Recital Mirage
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Revision as of 12:18, 10 February 2012

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