The input to the ReaderwareAW report writer is an HTML template which
defines the layout and formatting options of the report. ReaderwareAW then
merges in the data from your database and displays the output.
Do a search to establish the content for your report. The ReaderwareAW report writer uses the current search results as input. So you could search for all titles to produce a full report, search by a given artist or category etc.That is how you create and print a report with the ReaderwareAW Report Writer. Try some of the other sample reports distributed with ReaderwareAW. There is an example of creating labels and creating a detail report with images. The next topic discusses how you create the template files.Open the ReaderwareAW Report Writer Window by selecting the File->Report Writer menu item.
Select the ReaderwareAW basic image report, (awBasicImageReport.html), from the list. You will see the file displayed in the window, but instead of data, you will see text like [[$TITLE]], [[$ARTIST]] etc. This is the report template, the [[$----] fields identify what ReaderwareAW database fields will be displayed and where.
Click on the Run button,
, or select the File->Run menu item. ReaderwareAW will then populate the report template with the contents of the current search results. The report will then be displayed in the window.
To print the report select the Print toolbar button,
, or to save it in HTML format select the Save,
, button. You can use the saved HTML file on your web site or load it into your regular browser and print it from there.
To display the report in your default browser, select the Browser toolbar button,
. The browser is then opened and the report displayed. You can print the report from your default browser if you prefer.
You can return to the ReaderwareAW Main Window and perform another search, then in the report writer just click on the run button again to produce another report with the new data.
The basic idea is that you simply create the HTML to produce the desired report, but instead of using real data you use predefined ReaderwareAW keywords that determine where ReaderwareAW will insert the data. Consider the template for the basic table example:
<HTML>This is fairly standard HTML, the interesting part is between the [[$BEGIN_READERWAREAW]] and [[$END_READERWAREAW]] lines. These lines mark the section of code that ReaderwareAW will duplicate, once for each CD to be displayed. You can see that between these lines the HTML statements define a new row within the table. So if you have five CDs in your result set, ReaderwareAW will duplicate this section five times creating a five row table.
<HEAD>
<TITLE>ReaderwareAW Basic Table Example</TITLE>
</HEAD><BODY>
<CENTER><FONT COLOR=#0000FF><H2>ReaderwareAW Basic Table Example</H2></FONT></CENTER><TABLE ALIGN=CENTER BORDER=3 CELLPADDING=5>
<TR>
<TH>Title</TH>
<TH>Artist</TH>
<TH>UPC</TH>
<TH>Est. Value</TH>
</TR>[[$BEGIN_READERWAREAW]]
<TR>
<TD>[[$TITLE]]</TD>
<TD>[[$ARTIST]]</TD>
<TD>[[$UPC]]</TD>
<TD>[[$VALUE]]</TD>
</TR>
[[$END_READERWAREAW]]</TABLE>
</BODY></HTML>
Within this section you can see several ReaderwareAW database column names, for example [[$TITLE]] indicates this is where ReaderwareAW is to place the CD title, ReaderwareAW simply substitutes these keywords with the database values. That's really all there is to it. Here is the HTML file that ReaderwareAW might generate from the above template
<HTML>
<HEAD>
<TITLE>ReaderwareAW Basic Table Example</TITLE>
</HEAD><BODY>
<CENTER><FONT COLOR=#0000FF><H2>ReaderwareAW Basic Table Example</H2></FONT></CENTER><TABLE ALIGN=CENTER BORDER=3 CELLPADDING=5>
<TR>
<TH>Title</TH>
<TH>Artist</TH>
<TH>UPC</TH>
<TH>Est. Value</TH>
</TR><TR>
<TD>Synchronistic Wanderings</TD>
<TD>Benatar, Pat</TD>
<TD>724349980327</TD>
<TD>$31.99</TD>
</TR><TR>
<TD>Whoa Nelly!</TD>
<TD>Furtado, Nelly</TD>
<TD>600445021723</TD>
<TD>$13.29</TD>
</TR><TR>
<TD>Tell Me Something: The Songs of Mose Allison</TD>
<TD>Morrison, Van</TD>
<TD>731453320321</TD>
<TD>$14.99</TD>
</TR><TR>
<TD>Faith and Courage</TD>
<TD>O'Connor, Sinead</TD>
<TD>075678333729</TD>
<TD>$14.99</TD>
</TR><TR>
<TD>Ancient Heart</TD>
<TD>Tikaram, Tanita</TD>
<TD>075992583923</TD>
<TD>$14.99</TD>
</TR></TABLE>
</BODY></HTML>
The disk and track sections of the template are identified by special keywords. For example:
[[$BEGIN_READERWAREAW]]The above is not a complete template, but it illustrates how you would display disk and track information. The [[$BEGIN_READERWAREAW]]...[[$END_READERWAREAW]] identifies the complete ReaderwareAW template, this section will be duplicated once for each CD you are displaying. There is HTML to display the CD cover image, title and artist information.
<TR>
<TD>[[$IMAGE]]</TD>
<TD>[[$TITLE]]<BR>[[$ARTIST]]</TD>
</TR>[[$BEGIN_READERWAREAW_DISKS]]
<TR>
<TD>DISK [[$DISKNUMBER]]:</TD>
</TR>
[[$BEGIN_READERWAREAW_TRACKS]]
<TR COLSPAN=2>
<TD>[[$TITLE]]</TD>
</TR>
[[$END_READERWAREAW_TRACKS]]
[[$END_READERWAREAW_DISKS]]
[[$END_READERWAREAW]]
The [[$BEGIN_READERWAREAW_DISKS]]...[[$END_READERWAREAW_DISKS]] identifies the section that will be duplicated once for each disk within each CD. In this example it displays the disk number.
Finally the [[$BEGIN_READERWAREAW_TRACKS]]...[[$END_READERWAREAW_TRACKS]] identifies the section that will be duplicated once for each track, within each disk, within each CD. This section displays track title information. Note that this section is within the disk section of the template. This is the normal way you would code this, you want the tracks listed for each disk. If you use the tracks section on it's own, ReaderwareAW will display track information for the first disk only.
There is an example template, awTrackReport.html included with the product.
This is a complete template that displays disk and track information.
Mac OS X users will find the reports folder inside the application package. Control-click on the program icon. Select Show package contents from the popup menu. Double click on Contents, Resources, Java, reports.
Readerware readerware\reports\RW ReaderwareAW readerware\reports\AW ReaderwareVW readerware\reports\VW
If you develop custom reports that you think might be useful to other users,
please consider sending them in. They may be placed on the Readerware web
site where others can use and learn from them. Full credit will be given
to the author or you can remain anonymous if you prefer. Just e-mail any
templates to support@readerware.com.
[[$BEGIN_READERWARE]]
.
.
.
[[$END_READERWARE]]
Sometimes you need to display multiple records within the marked section. Consider a two column table where you want each column to display a record from the database. Effectively you want to duplicate a table row for each two records. You do this with the [[$INCR_READERWARE]] statement. It tells ReaderwareAW to fetch the next record from the database. For example:
<TABLE>
[[$BEGIN_READERWARE]]
<TR>
<TD>[[$TITLE]]<BR>[[$ARTIST]]</TD>[[$INCR_READERWARE]]
<TD>[[$TITLE]]<BR>[[$ARTIST]]</TD>
</TR>
[[$END_READERWARE]]
</TABLE>
[[$TITLE]] | CD Title |
[[$ARTIST]] | Artist |
[[$LABEL]] | CD Label |
[[$COMPOSER]] | Composer |
[[$CONDUCTOR]] | Conductor |
[[$DATE]] | CD release date |
[[$COPYDATE]] | Copyright date |
[[$RUNNINGTIME]] | Total time |
[[$VALUE]] | Estimated value of this CD |
[[$VALUEDATE]] | Valuation date |
[[$COPIES]] | Number of copies owned |
[[$UPC]] | UPC or bar code |
[[$ISBN]] | ISBN formatted for display, e.g. 0-684-87301-X |
[[$RAWISBN]] | Raw ISBN, no formatting, e.g. 068487301X |
[[$FORMAT]] | CD format |
[[$SERIES]] | CD Series |
[[$SOUND]] | Sound format |
[[$RATING]] | Rating |
[[$CONDITION]] | Condition |
[[$CATEGORY]] | Category |
[[$LOCATION]] | Location where this CD is stored |
[[$KEYWORDS]] | Keywords describing this CD |
[[$PLAYED]] | CD played? |
[[$PRINT]] | Include in ReaderwareAW reports? |
[[$HTMLEXPORT]] | Include in ReaderwareAW exports? |
[[$COMMENTS]] | Comments |
[[$DATEENTERED]] | Date entered into the ReaderwareAW database |
[[$SOURCE]] | Source of import |
[[$ROWKEY]] | Internal row key, also used to store images |
[[$CART]] | CD in shopping cart? |
[[$ORDERED]] | CD ordered |
[[$LCCN]] | LCCN (Library of Congress) |
[[$DEWEY]] | Dewey decimal number |
[[$DEWEYLABEL]] | Dewey decimal number. Standard format, Library of Congress extensions removed. |
[[$USERNUM]] | User defined CD number |
[[$DISKCOUNT]] | Number of discs in this set |
[[$ARTISTURL]] | Link to the artists web site |
[[$LOANTO]] | Loaned to |
[[$LOANDATE]] | Loan date |
[[$LOANDUE]] | Loan due date |
[[$USER1 - USER10]] | User defined fields |
[[$IMAGENAME]] | The name of the image file |
[[$IMAGE]] | The full path of the image file |
[[$CURRENTDATE]] | The current date |
All keywords must be in uppercase as shown above. They can be in any order,
but must appear between the [[$BEGIN_READERWAREAW]] and [[$END_READERWAREAW]]
lines otherwise they will be ignored.
[[$DISKNUMBER]] | Disk Number |
All keywords must be in uppercase as shown above. They can be in any order,
but must appear between the [[$BEGIN_READERWAREAW_DISKS]] and [[$END_READERWAREAW_DISKS]]
lines otherwise they will be ignored.
[[$TRACKNUMBER]] | Track Number |
[[$TITLE]] | Track Title |
[[$ARTIST]] | Track Artist |
[[$RUNNINGTIME]] | Track time |
[[$WRITER]] | Track song writer |
All keywords must be in uppercase as shown above. They can be in any order,
but must appear between the [[$BEGIN_READERWAREAW_TRACKS]] and [[$END_READERWAREAW_TRACKS]]
lines otherwise they will be ignored. Normally the tracks section itself
is embedded within the disks section.
-U | Display the value in uppercase |
-L=n | Limit the value displayed to at most n characters |
-S=n | Display the value starting at the nth character. This is relative to 0. |
The modifiers must immediately follow the report writer keyword. For example:
[[$ARTIST-U]]
This will display the artist in uppercase.
You can apply multiple modifiers to a keyword. For example:
[[$ARTIST-U-L=3]]
This will display the first three characters of the artist in uppercase.