The Readerware Report Writer

The Readerware Report Writer allows you to easily define your own custom reports in virtually any format, with images. You can view, print and save the output.

The input to the Readerware report writer is an HTML template which defines the layout and formatting options. Readerware then merges in your data to create an HTML file. As the output is in HTML format you can view it any browser, print it or save the output to a file and upload it to a web site.

Printing a custom report

The easiest way to get started is to use one of the templates that are shipped with Readerware. To produce a report do the following:
Search to establish the content for your report. The Readerware 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 author or category etc.

Open the Readerware Report Writer Window by selecting the File->Report Writer menu item.

Select the Readerware basic image report, (BasicImageReport.html), from the list. You will see the template displayed in the window, but instead of data, you will see text like [[$AUTHOR]], [[$TITLE]] etc. The [[$----] fields identify which Readerware database fields will be displayed and where.

Click on the Create Report button. Readerware will then populate the report template with the contents of the current search results and display the output in your browser. You can view, print or save the report from your browser.
That is how you print a report with the Readerware Report Writer.

Creating a report template

A Readerware Report Writer template file is in HTML format so you do need to understand a bit about HTML to take full advantage of all the customization and formatting options available.

The basic idea is that you create the HTML to produce the desired report, but instead of using real data you use predefined Readerware keywords that determine where Readerware will insert the data. Consider the template for the basic table example used earlier:

<HTML>
<HEAD>
   <TITLE>Readerware Basic Table Example</TITLE>
</HEAD>

<BODY>
<CENTER><FONT COLOR=#0000FF><H2>Readerware Basic Table Example</H2></FONT></CENTER>

<TABLE ALIGN=CENTER BORDER=3 CELLPADDING=5>
<TR>
<TH>Author</TH>
<TH>Title</TH>
<TH>ISBN</TH>
<TH>Est. Value</TH>
</TR>

[[$BEGIN_READERWARE]]
<TR>
<TD>[[$TITLE]]</TD>
<TD>[[$AUTHOR]]</TD>
<TD>[[$ISBN]]</TD>
<TD>[[$VALUE]]</TD>
</TR>
[[$END_READERWARE]]

</TABLE>
</BODY>

</HTML>

This is fairly standard HTML, the interesting part is between the [[$BEGIN_READERWARE]] and [[$END_READERWARE]] lines. These lines mark the section of code that Readerware will duplicate, once for each book 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 books in your result set, Readerware will duplicate this section five times creating a five row table.

Within this section you can see several Readerware database column names, for example [[$TITLE]] indicates this is where Readerware is to place the book title, Readerware simply substitutes these keywords with the database values. That's really all there is to it. Here is the HTML file that Readerware might generate from the above template

<HTML>
<HEAD>
   <TITLE>Readerware Basic Table Example</TITLE>
</HEAD>

<BODY>
<CENTER><FONT COLOR=#0000FF><H2>Readerware Basic Table Example</H2></FONT></CENTER>

<TABLE ALIGN=CENTER BORDER=3 CELLPADDING=5>
<TR>
<TH>Author</TH>
<TH>Title</TH>
<TH>ISBN</TH>
<TH>Est. Value</TH>
</TR>
 

<TR>
<TD>In a Dry Season</TD>
<TD>Robinson, Peter</TD>
<TD>0-380-97581-5</TD>
<TD>$24.00</TD>
</TR>

<TR>
<TD>Roses, Roses</TD>
<TD>James, Bill</TD>
<TD>0-393-04637-0</TD>
<TD>$23.00</TD>
</TR>

<TR>
<TD>The Breaker</TD>
<TD>Walters, Minette</TD>
<TD>0-399-14492-7</TD>
<TD>$23.95</TD>
</TR>

<TR>
<TD>The Running Woman</TD>
<TD>Carlon, Patricia</TD>
<TD>1-56947-110-X</TD>
<TD>$21.00</TD>
</TR>

<TR>
<TD>The Scold's Bridle</TD>
<TD>Walters, Minette</TD>
<TD>0-312-95612-6</TD>
<TD>$6.99</TD>
</TR>
 

</TABLE>
</BODY>

</HTML>


Accessing Volume and Chapter Information

Each book in a Readerware database is made up of the basic information like author and title. It then has one or more volume entries that you can use for the contents. For many books you may not use these but for multiple volume sets, magazines etc. you might want to enter the contents. If you want to display volume and chapter information in your report, you must include a volume and chapter section in your template. Readerware will then automatically handle any number of volumes and chapters. The volume template section is repeated for each volume and the chapter template section for each chapter within the volume.

The volume and chapter sections of the template are identified by special keywords. For example:

[[$BEGIN_READERWARE]]
<TR>
<TD>[[$IMAGE]]</TD>
<TD>[[$TITLE]]<BR>[[$AUTHOR]]</TD>
</TR>

[[$BEGIN_READERWARE_VOLUMES]]
<TR>
<TD>Volums [[$VOLUMENUMBER]]:</TD>
</TR>
[[$BEGIN_READERWARE_CHAPTERS]]
<TR COLSPAN=2>
<TD>[[$TITLE]]</TD>
</TR>
[[$END_READERWARE_CHAPTERS]]
[[$END_READERWARE_VOLUMES]]
[[$END_READERWARE]]

The above is not a complete template, but it illustrates how you would display volume and chapter information. The [[$BEGIN_READERWARE]] ... [[$END_READERWARE]] identifies the complete Readerware template, this section will be duplicated once for each book you are displaying. There is HTML to display the cover image, title and author information.

The [[$BEGIN_READERWARE_VOLUMES]] ... [[$END_READERWARE_VOLUMES]] identifies the section that will be duplicated once for each volume within each set. In this example it displays the volume number.

Finally the [[$BEGIN_READERWARE_CHAPTERS]] ... [[$END_READERWARE_CHAPTERS]] identifies the section that will be duplicated once for each chapter, within each volume, within each book. This section displays title information. Note that this section is within the volume section of the template. This is the normal way you would code this, you want the chapters listed for each volume. If you use the chapters section on it's own, Readerware will display chapter information for the first volume only.

Getting Started

You might want to start with one of the examples included with Readerware and adapt them for you own use, or you can start from scratch.

To start with an existing template, select it in the report writer window. Copy/Paste the template into a text editor like Notepad or TextEdit.

To remove a template you no longer use select the File->Remove template menu item.

To install your template select the File->Install template menu item.

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.

You can browse user contributed templates in the Readerware Knowledge Base.

Report Writer Templates

Report writer templates are standard HTML files with an embedded section that is duplicated for each database record displayed. This section is marked by the following statements:

[[$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 Readerware to fetch the next record from the database. For example:

<TABLE>
[[$BEGIN_READERWARE]]
<TR>
<TD>[[$TITLE]]<BR>[[$AUTHOR]]</TD>[[$INCR_READERWARE]]
<TD>[[$TITLE]]<BR>[[$AUTHOR]]</TD>
</TR>
[[$END_READERWARE]]
</TABLE>


Report Writer Keywords

The following is a full list of the keywords recognized by Readerware. These will be replaced by the appropriate data from the database.
 
[[$AUTHOR]] Book Author, displayed in selected format
[[$AUTHORLAST]] Book Author, displayed in Last, First format
AUTHORBIOLINK Display a link the use can click on to open the author contributor dialog. Includes image, biography etc.
[[$AUTHOR2]] - [[$AUTHOR6]] Additional Authors
[[$TRANSLATOR]] Book Translator
[[$ILLUSTRATOR]] Book Illustrator
[[$EDITOR]] Book Editor
[[$TITLE]] Book Title
[[$ALTITLE]] Alternate title
[[$SUBTITLE]] Book Subtitle
[[$ISBN]] ISBN-13 formatted for display, e.g. 978-0-684-87301-5
[[$ISBN-10]] ISBN-10 formatted for display, e.g. 0-684-87301-X
[[$RAWISBN]] Raw ISBN-13, no formatting, e.g. 9780684873015
[[$RAWISBN-10]] Raw ISBN-10, no formatting, e.g. 068487301
[[$ASIN]] Amazon Standard Identification Number
[[$ISBN/ASIN]] ISBN-13 formatted for display, e.g. 978-0-684-87301-5. If there is no ISBN, this keyword returns the ASIN instead.
[[$RAWISBN/ASIN]]] Raw ISBN-13, no formatting, e.g. 9780684873015. If there is no ISBN, this keyword returns the ASIN instead.
[[$PUBLISHER]] Publisher
[[$FORMAT]] Book format, hardcover paperback etc.
[[$TYPE]] Display type
[[$EDITION]] Book edition
[[$LANGUAGE]] Language
[[$SIGNED]] Signed?
[[$DATE]] Release/Publication date
[[$PUBPLACE]] Place published
[[$COPIES]] Number of copies owned
[[$RATING]] User rating
[[$CONDITION]] Condition
[[$COVERCONDITION]] Cover condition
[[$CATEGORY1]] -
[[$CATEGORY3]]
Categories
[[$READ]] Number of times book has been read
[[$LASTREADATE]] The last time the book was read
[[$PRODUCTINFO]] Product information, reviews etc.
[[$COMMENTS]] Comments
[[$DATEENTERED]] Date entered into the Readerware database
[[$DATEUPDATED]] Date last updated
[[$ROWKEY]] The Book ID, this is a unique ID alocated to each book automatically as it is added to the database
[[$LCCN]] LCCN (Library of Congress)
[[$DEWEY]] Dewey decimal number
[[$DEWEYLABEL]] Dewey decimal number. Standard format, Library of Congress extensions removed.
[[$BARCODE]] Barcode
[[$CALLNUM]] Library of Congress Call Number
[[$USERNUM]] User defined book number
[[$COPYDATE]] Copyright date
[[$LOCATION]] Book location
[[$SERIES]] Book series
[[$SERIESNUMBER]] Series number
[[$PAGES]] Page count
[[$KEYWORDS]] Book keywords
[[$DIMENSIONS]] Book dimensions
[[$WEIGHT]] Book weight
[[$READINGLEVEL]] Reading level
[[$LEXILELEVEL]] The Lexile Framework for Reading is an educational tool that uses a Lexile to match readers of all ages with books
[[$SOURCE]] Source of import
[[$PURCHASEPRICE]] Price paid
[[$PURCHASEDATE]] Date purchased
[[$PURCHASEPLACE]] Where purchased
[[$LISTPRICE]] List price
[[$VALUE]] Estimated value of this book
[[$VALUEDATE]] Valuation date
[[$SALEPRICE]] Sale price
[[$SALEDATE]] Date sold
[[$NEWPRICE]] New copy price
[[$NEWCOUNT]] Number of new copies available
[[$USEDPRICE]] Used copy price
[[$USEDCOUNT]] Number of used copies available
[[$COLPRICE]] Collectible copy price
[[$COLCOUNT]] Number of collectible copies available
[[$SALESRANK]] Sales rank
[[$FAVORITE]] Is this a favorite book?
[[$OUTOFPRINT]] Is this book out of print?
[[$MEDIAURL]] Local copy of media
[[$OWNER]] Owner of this book
[[$STATUS]] Book status
[[$EXTERNALID]] External ID for this Book
[[$INVENTORY]] Book inventory count
[[$IMAGE1]] IMG tag for the first image
[[$IMAGE2]] IMG tag for the second image
[[$LARGEIMAGE1]] IMG tag for the first large image
[[$LARGEIMAGE2]] IMG tag for the second large image
[[$BESTIMAGE1]] IMG tag for the first image. Looks for the large image, if not found uses the normal image
[[$BESTIMAGE2]] IMG tag for the second image. Looks for the large image, if not found uses the normal image
[[$VOLUMECOUNT]] Number of volumes
[[$AUTHORURL]] Author web site
[[$USER1]] -
[[$USER10]]
User defined fields
[[$LOANTO]] Loaned to
[[$LOANDATE]] Loan date
[[$LOANDUE]] Loan due date
[[$LASTLOANDATE]] The last date this book was loaned out
[[$LOANCOUNT]] The number of times this book has been loaned out
[[$CURRENTDATE]] The current date
[[$TEMPLATESDIR]] URL pointing to the templates directory

All keywords must be in uppercase as shown above. They can be in any order, but must appear between the [[$BEGIN_READERWARE]]  and [[$END_READERWARE]] lines otherwise they will be ignored.
 
 

Report Writer Volume Keywords

The following is a full list of the volume section keywords recognized by Readerware. These will be replaced by the appropriate data from the database.
 
[[$VOLUMENUMBER]] Volume Number
[[$VOLUMETITLE]] Volume Title
[[$USER1 - USER2]] User defined volume fields

All keywords must be in uppercase as shown above. They can be in any order, but must appear between the [[$BEGIN_READERWARE_VOLUMES]]  and [[$END_READERWARE_VOLUMES]] lines otherwise they will be ignored.
 
 

Report Writer Chapter Keywords

The following is a full list of the chapters section keywords recognized by Readerware. These will be replaced by the appropriate data from the database.
 
[[$CHAPTERNUMBER]] Chapter Number
[[$TITLE]] Chapter Title
[[$AUTHOR]] Chapter author
[[$READ]] Number of times the chapter has been read
[[$COMMENTS]] Comments
[[$MEDIAURL]] Local copy of media
[[$USER1 - USER2]] User defined chapter fields

All keywords must be in uppercase as shown above. They can be in any order, but must appear between the [[$BEGIN_READERWARE_CHAPTERS]]  and [[$END_READERWARE_CHAPTERS]] lines otherwise they will be ignored. Normally the chapters section itself is embedded within the volumes section.
 
 

Keyword Modifiers

The following is a full list of the modifiers that can be applied to any of the report writer keywords. These will modify the database values, i.e. display the database value in uppercase.
 
-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.
-Y Used with date fields, this will display the year only instead of the full date.
-H Hide if empty. Do not display anything if this field is empty. For example [[$IMAGE]] will display the default image if there is no cover art. [[$IMAGE-H]] will display nothing if there is no image.
-H=text Display the specified text if the database field is not empty. If the field is empty, nothing is output. Suppose you want to display the release date in brackets, but you don't want to display empty brackets if there is no date. Use [[$DATE-H=(]][[$DATE]][[$DATE-H=)]]

The modifiers must immediately follow the report writer keyword. For example:

[[$AUTHOR-U]]
This will display the author in uppercase.

You can apply multiple modifiers to a keyword. For example:

[[$AUTHORLAST-U-L=3]]

This will display the first three characters of the author in uppercase.

Top of Page


Copyright © 1999-2017 Readerware Corporation