WebQuery has a number of properties and messages which are intended to be public - those are documented here.
This is just the standard framework property controlling what is displayed as the title of the WebQuery UI panel - you can set it to whatever you like. The default is "WebQuery Definition".
This property should contain the Object ID of the object which controls session management for your web application, however even if you have customised the session management in your web app you should not need to modify this property setting because it defaults to the global variable ghoWebSessionManager which you will need to have popualated with whatever Object ID you have filling that role.
This property defines the function which WebQuery will call to discover whether the current session is for a logged-in user. If you have customised the session management within your web application to make this different from the standard, you can tell WebQuery about it by having a line in your web app after the "Use WebQuery.wo" line of the form:
Set phLoggedInFunc of oWebQuery to (RefFunc(YourFunctionName))
It defaults to IsLoggedIn.
Set phUserNameFunc of oWebQuery to (RefFunc(YourFunctionName))
It defaults to psLoginName.
This property determines where under your web app's AppHTML directory WebQuery will write its temporary HTML files prior to sending them to the browser for display to the user. It must point to a directory which is accessible to the web server. By default it is set to "WebQuery" and will thus cause a directory named "AppHTML/WebQuery" to be created when a report is first run.
The files written to this directory are deleted as soon as they are loaded in the web browser by a piece of JavaScript embedded in their HTML which makes a call back to the WebApp, so this directory should always be empty.
This mechanism also means that users cannot "reload" reports because as soon as they have seen them, the file on which they are based has already been deleted - they must run the query again to see the output again.
This property determines where saved queries will be written to on your web server. It should not be in a location accessible to the web server, but the web application should be able to read, write and create in it.
By default this is set to your application's home directory (the psHome property of the oApplication's phoWorkspace object) plus "WebQuery".
When a user first attempts to open or save a query, this directory will be created, along with two subdirectories: "Public" and one named for the user's login name. Other users will then have their own directories created within it as they use the open or save query features.
This property determines where downloads (in HTML, CSV, Text or XML format) will be written to. It should not be in a location accessible to the web server, but the web application should be able to read, write and create in it.
By default it is the same as psStoreDirectory above.
Files created in this directory will be sent to the user's browser as downloads through the CustomDownlLoadURL mechanism of the oWebResourceManager object. They will be deleted when the user clicks on the "Click when done" button displayed during download operations.
This property, which is false by default, determines whether "<" and ">" symbols in the report data will be replaced in the output with their respective "HTML entities": < and > (if false), or be output unchanged (if true).
Setting this to true will allow HTML embedded in the output to be sent intact to the browser, allowing such things as HTML links and images to appear in reports. See the sample report "Sales Person Pictures" for an example of this.
This property (which defaults to False) will control the initial checked state of the "Use SQL" checkbox on the Output tab. It will also control its state following a "Clear query" action (i.e. if the user clicks the "Clear query" button).
This message takes an integer argument which is the filelist file-number of a table to exclude from WebQuery so that the users never see it.
The preferred mechanism for using it is to place a line such as:
Send ExcludeTable of oWebQuery tablename.File_Number
In your WebApp.src below the "Use WebQuery.wo" line, however for most tables you will need to open them first, so write:
Open tablename Send ExcludeTable of oWebQuery tablename.File_Number
Alternative you can simply pass the integer file number of the table within filelist.cfg, but this mechanism will break if table numbers are changed.
Table whose "Description" (User Display Name) begins with an "@" character will always be excluded from WebQuery.
Note: Excluding tables will break any relational chains which pass through them, meaning that tables they relate to will not appear in the list of available tables if a child table of theirs is selected as the Main Table for a query
This message clears down WebQuery's list of excluded tables and can be used in conjunction with the above ExcludeTable message to dynamically hide and show tables depending on some factor(s) such as the access rights of the user.
This message takes two integer arguments which are the filelist file-number of a table and the number of a field within it to exclude from WebQuery so that the users never see it.
The preferred mechanism for using it is to place a line such as:
Send ExcludeField of oWebQuery File_Field tablename.fieldname
In your WebApp.src below the "Use WebQuery.wo" line, however for most tables you will need to open them first, so write:
Open tablename Send ExcludeField of oWebQuery File_Field tablename.fieldname
Alternative you can simply pass the integer file number of the table within filelist.cfg followed by the field number, but this mechanism will break if table numbers or field numbers are changed.
Fields whose name begins with an "@" character will always be excluded from WebQuery.
This message clears down WebQuery's list of excluded fields and can be used in conjunction with the above ExcludeField message to dynamically hide and show fields depending on some factor(s) such as the access rights of the user.
This function returns the path of the directory in which queries have been saved as "Public", which will be the same as:
(psOutputDirectory(oWebQuery) + "\Public")
Note: It does not guarantee that the directory actually exists yet.
This function returns the path of the directory in which queries by the currently logged-in user have been saved as private (i.e. under "My Queries"). This will be the same as:
(psOutputDirectory(oWebQuery) + "\User's Login Name")
If the user is not logged in it will return an empty string.
Note: It does not guarantee that the directory actually exists yet.
This message will cause WebQuery to load a saved query from file and immediately run it.
It can be used to place predefined reports onto the menus (see the sample reports provided under "Reports" menu in this program) or elsewhere in your web application.
It takes a single argument which should be the full path and name of a saved query, for example:
Send LoadAndRun of oWebQuery "C:\WebQueryReports\Some Report Name.wqr"
You can access queries which have been saved as "public" using the technique:
Send LoadAndRun of oWebQuery (PublicPath(oWebQuery(Self)) + "\Users List.wqr")