Xataface HTML Reports Module 0.2
HTML Reports Module for Xataface
|
In the previous example we created a rather useless report template. It does nothing except print "Hello World" once for each record in a found set. In this section we'll expand on this example to turn out report into something a little bit more useful.
Before getting into the features of the WYSIWYG editor, let's take a quick look at how the report generator parses fields embedded in templates.
Suppose you have a field named first_name
in the table that is the subject of a report. Then you can embed the value of the first_name
field into a report by adding {$first_name}
to the template. E.g.
<p>First Name: {$first_name}</p>
would be rendered as
<p>First Name: Steve</p>
when run on a record whose first_name
field contained the value "Steve".
In order to assist you in creating your templates, the HTML Reports module includes a field browser that allows you to browse through the fields in your table and add them to your template by selecting them with your mouse. Read on for details on how to add fields using this method.
The Tablename dropdown list on the report form allows us to specify the table on which this report is meant to run. In my particular case, I'm going to create a report to run on my Tools table. You can select any table you like for your example.
We left off the last example with a nearly blank template with only the text "Hello World". Now we're going to change it slightly. I Want the template to say "Hello {$tool_name}" where {$tool_name} is the name of a tool. When the report is run on a set of tool records, I want to to have one line per tool in the found set.
Steps:
Try adding some more fields to your template and then preview it. See how "useful" you can make it look
We still haven't saved our template. We'll finally get a chance to do that in the next section: Publishing Reports for Other Users