The input to the ReaderwareVW report writer is an HTML template which
defines the layout and formatting options of the report. ReaderwareVW then
merges in the data from your database and displays the output.
Do a search to establish the content for your report. The ReaderwareVW 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 actor or category etc.That is how you create and print a report with the ReaderwareVW Report Writer. Try some of the other sample reports distributed with ReaderwareVW. 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 ReaderwareVW Report Writer Window by selecting the File->Report Writer menu item.
Select the ReaderwareVW basic image report, (vwBasicImageReport.html), from the list. You will see the file displayed in the window, but instead of data, you will see text like [[$TITLE]], [[$ACTOR1]] etc. This is the report template, the [[$----] fields identify what ReaderwareVW database fields will be displayed and where.
Click on the Run button,
, or select the File->Run menu item. ReaderwareVW 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 ReaderwareVW 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 ReaderwareVW keywords that determine where ReaderwareVW 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_READERWARE]] and [[$END_READERWARE]] lines. These lines mark the section of code that ReaderwareVW will duplicate, once for each video 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 videos in your result set, ReaderwareVW will duplicate this section five times creating a five row table.
<HEAD>
<TITLE>ReaderwareVW Basic Table Example</TITLE>
</HEAD><BODY>
<CENTER><FONT COLOR=#0000FF><H2>ReaderwareVW Basic Table Example</H2></FONT></CENTER><TABLE ALIGN=CENTER BORDER=3 CELLPADDING=5>
<TR>
<TH>Title</TH>
<TH>Actor</TH>
<TH>Actor</TH>
<TH>Actor</TH>
<TH>UPC</TH>
<TH>Est. Value</TH>
</TR>[[$BEGIN_READERWARE]]
<TR>
<TD>[[$TITLE]]</TD>
<TD>[[$ACTOR1]]</TD>
<TD>[[$ACTOR2]]</TD>
<TD>[[$ACTOR3]]</TD>
<TD>[[$UPC]]</TD>
<TD>[[$VALUE]]</TD>
</TR>
[[$END_READERWARE]]</TABLE>
</BODY></HTML>
Within this section you can see several ReaderwareVW database column names, for example [[$TITLE]] indicates this is where ReaderwareVW is to place the video title, ReaderwareVW simply substitutes these keywords with the database values. That's really all there is to it. Here is the HTML file that ReaderwareVW might generate from the above template
<HTML>
<HEAD>
<TITLE>ReaderwareVW Basic Table Example</TITLE>
</HEAD><BODY>
<CENTER><FONT COLOR=#0000FF><H2>ReaderwareVW Basic Table Example</H2></FONT></CENTER><TABLE ALIGN=CENTER BORDER=3 CELLPADDING=5>
<TR>
<TH>Title</TH>
<TH>Actor</TH>
<TH>Actor</TH>
<TH>Actor</TH>
<TH>UPC</TH>
<TH>Est. Value</TH>
</TR>
<TR>
<TD>Inspector Morse: The Wolvercote Tongue</TD>
<TD>Thaw, John</TD>
<TD>Whately, Kevin</TD>
<TD></TD>
<TD>066805985171</TD>
<TD>$16.99</TD>
</TR><TR>
<TD>Lady and the Tramp 2: Scamp's Adventure</TD>
<TD>Roussel, Jeannine</TD>
<TD>Wolf, Scott</TD>
<TD>Milano, Alyssa</TD>
<TD>786936140446</TD>
<TD>$22.98</TD>
</TR><TR>
<TD>Lilith Fair: A Celebration of Women in Music</TD>
<TD>Colvin, Shawn</TD>
<TD>Crow, Sheryl</TD>
<TD>Girls, Indigo</TD>
<TD>014381985023</TD>
<TD>$19.98</TD>
</TR><TR>
<TD>Poirot: Death in the Clouds</TD>
<TD>Suchet, David</TD>
<TD>Jackson, Philip</TD>
<TD></TD>
<TD>054961362691</TD>
<TD>$19.98</TD>
</TR><TR>
<TD>Trial and Error</TD>
<TD>Sellers, Peter</TD>
<TD>Attenborough, Richard</TD>
<TD>Reid, Beryl</TD>
<TD>720917505725</TD>
<TD>$9.98</TD>
</TR>
</TABLE>
</BODY></HTML>
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 ReaderwareVW to fetch the next record from the database. For example:
<TABLE>
[[$BEGIN_READERWARE]]
<TR>
<TD>[[$TITLE]]<BR>[[$DIRECTOR]]</TD>[[$INCR_READERWARE]]
<TD>[[$TITLE]]<BR>[[$DIRECTOR]]</TD>
</TR>
[[$END_READERWARE]]
</TABLE>
[[$TITLE]] | Video Title |
[[$ACTOR1]] -
[[$ACTOR10]] |
Actors |
[[$DIRECTOR]] | Director |
[[$WRITER]] | Writer |
[[$SCREENWRITER]] | Screenwriter |
[[$DIRPHOTO]] | Director of Photography |
[[$COMPOSER]] | Composer |
[[$EDITOR]] | Editor |
[[$SERIES]] | Video series |
[[$UPC]] | UPC (Bar code) |
[[$ISBN]] | ISBN formatted for display, e.g. 0-684-87301-X |
[[$RAWISBN]] | Raw ISBN, no formatting, e.g. 068487301X |
[[$STUDIO]] | Studio |
[[$FORMAT]] | Video format, VHS, DVD, LaserDisc etc. |
[[$PLACE]] | Where produced |
[[$DATE]] | Video release date |
[[$COPYDATE]] | Copyright date |
[[$MPAA]] | Rating (MPAA or local) |
[[$WIDE]] | Widescreen? |
[[$CC]] | Closed Captioned? |
[[$SOUND]] | Sound format |
[[$COLOR]] | Color format |
[[$RUNNINGTIME]] | Running time |
[[$COPIES]] | Number of copies owned |
[[$RATING]] | Rating |
[[$CONDITION]] | Condition |
[[$CATEGORY]] | Category |
[[$VIEWED]] | Viewed? |
[[$PRINT]] | Include in ReaderwareVW reports? |
[[$HTMLEXPORT]] | Include in ReaderwareVW exports? |
[[$VALUE]] | Estimated value |
[[$VALUEDATE]] | Valuation date |
[[$COMMENTS]] | Comments |
[[$DATEENTERED]] | Date entered into the ReaderwareVW database |
[[$SOURCE]] | Source of import |
[[$ROWKEY]] | Internal row key, also used to store images |
[[$CART]] | Video in shopping cart? |
[[$ORDERED]] | Video ordered |
[[$LCCN]] | LCCN (Library of Congress) |
[[$DEWEY]] | Dewey decimal number |
[[$DEWEYLABEL]] | Dewey decimal number. Standard format, Library of Congress extensions removed. |
[[$USERNUM]] | User defined video number |
[[$LOCATION]] | Video location |
[[$BOOK]] | Book the video is based on |
[[$AUTHOR]] | Author of the book |
[[$KEYWORDS]] | Video keywords |
[[$TRACK1]] -
[[$TRACK20]] |
Track information |
[[$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_READERWARE]] and [[$END_READERWARE]]
lines otherwise they will be ignored.
-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:
[[$TITLE-U]]
This will display the title in uppercase.
You can apply multiple modifiers to a keyword. For example:
[[$TITLE-U-L=20]]
This will display the first 20 characters of the title in uppercase.