|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Teamstudio Edition 25 has shipped
It's finally here! Now that Teamstudio Edition 25 has shipped, listen to our latest Tool Time audio program to find out what's changed. Updates to all your favorite Teamstudio tools will be discussed.
Plus, you'll get an introduction to Teamstudio Undo (formerly known as Teamstudio Snapper).
Tap here to get started! |
|
|
|
|
|
|
|
|
|
|