Tutorial One |
Our first Tutorial will walk through the steps for creating a basic Query and Response report. Web Reports Wizard will create a program file that can be used to build a web report. The HTML form that can be used to call this report is in the subfolder called WebSite.
Unlike the dBASE Web Wizard, the Web Reports Wizard does not create the HTML document used to submit the query. However, if you use the dBASE Web Wizard to create a Query and Response Web application, the HTML form can be modified so that it will work with an application created by this Wizard.
Step One: Select a data source.
Step Two: Set field properties.
Step Three: Report options
Step Four: Report format
You can now preview the report with the Preview button. Then click the "writePRG" pushbutton if the report is laidout as desired. Select the WebSite folder and enter "Detail.prg" as the file name.
Step Five: Build the exe
The next step you must do from the dBASE command window. Minimize the Wizard and switch to dBASE. In the command window type the following:
compile website\details.prg build website\details.pro to website\details.exe web
Note: compiled versions of webClass.cc and Webreports.cc are required for this application. These files are included in the WebSite subfolder.
To deploy this report copy the following files to a folder on your web server.
details.exe details.htm webclass.co webreports.co
http://localhost/wreports/details.htm
Enter a Customer ID number, like 5, to view the orders for this customer.
Tutorial Two |
One problem with the report that was created in Tutorial One is that the user may not know the Customer ID number that they need to enter. For this reason it is useful to add a lookup report which lists the customers names and call the orders details report.
The first report that we will make is a lookup (or drill down) list. You can give the user the ability to list a portion of the customers by adding a filter to the lookup report, so we will add such a filter.
Step One: Select a data source.
Step Two: Set field properties.
Click the Field Properties button. On this page you can modify the heading caption, column width and cell alignment of the output table. For this tutorial you should make the following changes:
Step Three: Report options
Step Four: Report format
Preview the report if you would like, then click the "write PRG" button. Select the WebSite folder and save this program file as "Detail.prg."
Step Five: Build the exe
The next step you must do from the dBASE command window. Minimize the Wizard and switch to dBASE. In the command window type the following:
compile website\lookup.prg build website\lookup.pro to website\lookup.exe web
Deploy the files to the web server. Copy the following files to a folder on your web server.
lookup.exe lookup.htm
http://localhost/wreports/lookup.htm
Enter the letter "B" to get a list of customer whose last name starts with B. To see the orders for any one of the customers, click the hyper link. For example click on "Bouchereau"
Tutorial Three |
The third and fourth tutorial report will focus on the numerous formatting elements available for your reports. The Data Source for the third report will be the "Customer.dbf" table in the Samples folder. If you have just completed the second tutorial, this table will still be the data source. It is a good idea to select the table again because this action will reset the default values for the wizard. From the fields list, add "Name," "Street," "City," "ZipPostal," and "Phone."
We will use the default Field Properties, so click the Report Options button. Select Name as the index and Select Country as the filter field.
On the Report Format page set the following HTML table properties:
Next click the Column Format button. On this page you will set the header Row and the detail row properties.
Header Row Properties
What does a font size of "-1" mean? Push the F1 key to bring up the Help form. By using the F1 key the form will display the help document that corresponds to the current page.
Detail Row Properties
You can now preview the report.
If you set a filter this report can be used as a Query and Response application. For the tutorial, however, we will simply create a static report. To do this click the Save Report button, choose the WebSite subfolder and click Save.
Tutorial Four |
The fourth tutorial report will create a report with a group header.
The Data Source for this report is the "Stock.dbf" table in the Samples folder. Add this table to the report. From the fields list, add "Model," "Part No," "Description," and "Selling Price."
For this report we will use the default Field Properties, so click the Report Options button. On this page, select "Equipment Class" as the index name. Enable groups by checking the "Add a group heading to this report" and choose Equipment Class as the Group by field.
Next reload a saved template so that you don't need to reset the various formatting options. From the menu, select Template|restore. In the dialog form, select "Sample2.template"
On the Report Format page, give the report a title like "Stock by Equipment Class."
Then preview the report and save it as a static report with the name EquipmentClass.htm.
Tutorial Five |
This tutorial will use an SQL file that is in the Samples folder. Because this is a sample file, it does not use a database alias. Instead it finds the tables with a full path. To get the Select statement to work on your system you must edit the path to the tables. Be sure the path points to the samples folder as installed on your machine.