Difference between revisions of "SHOWDOCUMENT()"

From Lianjapedia
Jump to: navigation, search
Line 3: Line 3:
  
 
==Syntax==
 
==Syntax==
SHOWDOCUMENT(<expC1>[, <expC2>[, <expC3>]])
+
SHOWDOCUMENT(<expC>)
  
 
==See Also==
 
==See Also==
Line 9: Line 9:
  
 
==Description==
 
==Description==
The SHOWDOCUMENT() function displays a document in its associated plugin/application.
+
The SHOWDOCUMENT() function displays a document in its associated plugin/application or performs a Lianja UI action.  The <expC> is a URL, a file name or a Lianja UI Action.
  
 
{| class="wikitable" width="100%"
 
{| class="wikitable" width="100%"
!width="30%"|Parameter||Description
+
!width="30%"|Action||Description
 
|-
 
|-
|<expC1>||A URL or the name of a file.
+
|app:<id>||Switch to the specified App <id>.
 
|-
 
|-
|valign="top"|<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.
+
|valign="top"|page:<id>||Select the specified Page <id>.
 
|-
 
|-
|valign="top"|<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>.
+
|valign="top"|section:<id>?action=<actionid>||Perform the specified Action <actionid> on the specified Section <id>.<br>?action=search&text=expression<br>?action=first<br>?action=last<br>?action=next<br>?action=previous<br>?action=add<br>?action=delete<br>?action=refresh
 
|-
 
|-
 
|}
 
|}
 
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==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
// Accessing local files using '.pdf' and '.doc' file associations
+
// Accessing local files using '.pdf' and '.docx' file associations
showdocument("file://C:Documents and SettingsAll UsersDocumentsAcrobat.pdf")
+
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.pdf")
showdocument("file://C:Documents and SettingsAll UsersDocumentsWordDoc.doc")
+
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.docx")
  
 
// Remote ftp URL
 
// Remote ftp URL
showdocument("ftp://ftp.recital.com/LianjaUpdate-Win.exe")
+
showdocument("ftp://ftp.mycompany.com/latest.txt")
 
+
// 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
+
// Example to create an HTML file display in the default browser
// then invoke the browser on the client to display it
+
 
fp = fcreate("htmlfile&(getpid()).htm")
 
fp = fcreate("htmlfile&(getpid()).htm")
 
fwrite(fp, "<html>")
 
fwrite(fp, "<html>")

Revision as of 12:44, 4 March 2013

Purpose

Function to display a document in its associated plugin/application

Syntax

SHOWDOCUMENT(<expC>)

See Also

GETFILE(), SHOWHELP()

Description

The SHOWDOCUMENT() function displays a document in its associated plugin/application or performs a Lianja UI action. The <expC> is a URL, a file name or a Lianja UI Action.

Action Description
app:<id> Switch to the specified App <id>.
page:<id> Select the specified Page <id>.
section:<id>?action=<actionid> Perform the specified Action <actionid> on the specified Section <id>.
?action=search&text=expression
?action=first
?action=last
?action=next
?action=previous
?action=add
?action=delete
?action=refresh

Example

// Accessing local files using '.pdf' and '.docx' file associations
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.pdf")
showdocument("file:///C:\Users\Myuser\Documents\Documentation for HR\Attachments\Resume.docx")
 
// Remote ftp URL
showdocument("ftp://ftp.mycompany.com/latest.txt")
 
 
// Example to create an HTML file display in the default browser
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")