|
|
|
|
|
|
|
|
|
|
How to query Domino from within Excel (continued)
Creating your own Web queries needn't be a black art. Although there's no graphical user interface (unless you download the Notes database associated with this article!) for building them, the required text file is quick and simple to put together. There are only four lines of text required, and three of those are optional.
The query file format is shown below in Table A.
| Line # |
Description |
Sample |
Required |
| 1 |
QueryType |
WEB |
Optional |
| 2 |
Version Number |
1 |
Optional |
| 3 |
URL |
www.acme.com/Sales.nsf/Revenue?OpenView |
Mandatory |
| 4 |
POST |
parameters |
Optional |
The POST parameters are only required to emulate CGI forms where data is transferred to the server as an element separate from the URL. By contrast, GET parameters, are passed at the end of the URL. For Domino agents, all parameters will be passed on the URL, and so you'll never need the fourth line.
The simplest possible Web query file consists of a single line:
www.acme.com/Sales.nsf/Revenue?OpenView
|
However, since the first two optional lines are so simple to construct, you should make a practice of including them for future Office compatibility, thus the query would become:
WEB
1
www.acme.com/Sales.nsf/Revenue?OpenView
|
There are two more rules that you must follow to enable Web queries. They are:
- The file must be saved with an .IQY file extension
- The files must be saved to the QUERIES subdirectory of the user's Microsoft Office folder.
Advanced queries The query files described above do no more than save users the bother of typing URLs into the File Open dialog box. However, there can be more to Web Queries than running predetermined, canned queries you set up in query files.
First of all, you can add static parameters. For example, you could write a Web Query file to run the generic Web view agent supplied in October's DominoPower, where the name of the view to be queried (ExcelView) follows as a GET parameter:
WEB
1
www.acme.com/ExcelQry.nsf/ViewAgent?OpenAgent&ExcelView
|
More usefully, dynamic parameters can be added to Web queries. In this example, the Excel user can supply the name of any view in the database to be Web-queried:
WEB
1
www.acme.com/ExcelQry.nsf/ViewAgent?OpenAgent&["ViewName","Select view in database to query"]
|
You can place any number of dynamic parameters you like in a query, and mix them in with static parameters. Excel will replace the bracketed text with the value entered by the user at query time. The general form is:
["Parameter Name","Prompt String"]
|
Within the .IQY file specification, this is as far as you can go with dynamic queries. However, within Excel itself, your user has the choice of typing in a value directly in response to the prompt text, like that shown in Figure A, or supplying a cell address. The latter opens up further Excel development opportunities for Web queries.
[ Prev | Next ]
|
|
|
|
|
|
-- Advertisement --
2-Minute Tutorials
How do I...
- integrate MS Office or OpenOffice with Notes?
- create cross-tab reports and charts?
- print serial letters and mailing labels?
- create PDFs in Lotus Notes?
Check out the 2-minute tutorials here. |
-- Advertisement --
SECURTRAC - MONITOR AND CONTROL YOUR DOMINO ENVIRONMENT
When it comes to your business, how do you ensure compliance with SOX, HIPAA or other industry driven regulations? Use SecurTrac to monitor and audit the life cycle of all objects in your Domino environment.
- Database Monitor
- Mail Monitor
- Domino Directory Monitor
- Notes.ini File Monitor
- Intrusion Detection Monitor
Click here for details and a free evaluation copy. |
|
|
|
|
|
|
|
|