Verified Software Products Company
792 Phillips Road || Arroyo Grande, CA 93420-5019 || Phone: (805) 489-5309
Email: bkandler@verisof.com
SERVICES FREEBIES TIPS and TRICKS ARTICLES LINKS HOME
Our Products

Classes
BMPBMP
CryptoCrypto
CSVStringsCSVStrings
DataLoggerDataLogger
DatesDates
DebugRecorderDebugRecorder
FileNameSetFileNameSet
FileSenderFileSender
RDOConnectMasterRDOConnectMaster
ReportAidsReportAids
ShellerSheller
StringSetStringSet
WEBUtilitiesWEBUtilities

Modules
DAOLibDAOLib
GlobalsGlobals
RegistryRegistry

Programs
BatcherBatcher
HTMLGenHTMLGen
KillTimeKillTime
TimedMessageTimedMessage
ReportAids: This class takes advantage of the fixed pitch Courier font to make creating printed reports that always fit on the page almost effortless (even reports with dynamic content).

All that trouble with getting the right fit and alignment just goes away!

The workhorse of the class is the SetupReport method which determines the appropriate font size, page orientation, and number rows on a page based on the width of the report you need in characters. So you can concentrate on your report's content instead of its fit on the page!

Another useful method is TitleLine which creates PageWidth strings composed of left, center, and right parts. The primary use of TitleLine is in the construction of header/footer lines.

Properties are provided to give you access to and override control over Columns, Orientation, PointSize, Rows, PageWidth, PageHeight, MaxPointSize, and MinPointSize.

To see a sample use of ReportAids and its full interface definition, scroll down.
Download me at once!

Using True Type fonts for presentations is sexy and needed to get the proper pzazz. But for reports, good old Courier provides for easy reading and EASY generation. Especially if you use Report Aids to help you set up the printer with a font size that makes optimum use of the page. We've tested it exhaustively for page widths of from 70 to 240 columns.

This piece of code generates a report of WEB page statistics. The most important part is the third line where the SetupReport method is called to determine the font size, number of rows, and page orientation that will fit on a page where header1 indicates the length of the report lines. After that it's mostly a matter of keeping track of page end points. In the printing of the page header you see the use of the TitleLine method to easily construct print lines with left, center, and right parts.

      set aid = New ReportAids
      header1 = "               Document Name                Accesses  "+ _
	            "Robot_Accesses User_Accesses" + _
	            "     Bytes    Dwell"
      MaxRows = aid.SetupReport(Len(header1)) 'set up page size
      Page = 0                                'initialize for first page
      row = 999
      While Not rs.EOF                        'loop through data records
        .
        .                                     'get data to print
        .
        If row > MaxRows Then                 'check for new page
          Page = Page + 1                     'advance page count
          If Page <> 1 Then Printer.NewPage   '1st page doesn't need eject
          Printer.Print aid.TitleLine("", "Documents by Access Counts " + _
                                          "for VERIFIEDSOFTWARE.COM", "")
          Printer.Print aid.TitleLine("Week Ending " + ReportDate, "", _
                                      "Page " + str(Page))
          Printer.Print header1
          row = 3                       'account for header lines on page
        End If
        'print report line
        s = Pad(PageName, 43) + LPad(Format(Accesses, BF), 10) + ... 
        'setup report line
        Printer.Print s                       'print report line
        row = row + 1                         'account for line on page
        rs.MoveNext                           'move to next data record
      Wend
      If Page <> 0 Then                 'do totals if anything produced
        Printer.Print ...
      End If
      Printer.EndDoc                          'close up the document
    End If
    Set aid = Nothing

Below is the full interface definition for the ReportAids Class.
Public Property Get Columns() As Integer          
         'Get/Set number of columns in page width
Public Property Get MaxPointSize() As Single      
         'Get/Set maximum point size to use; default=12
Public Property Let MaxPointSize(ByVal NewMaxPointSize As Single) 
         'Get/Set maximum point 'size to use; default=12
Public Property Get MinPointSize() As Single      
         'Get/Set minimum point size for portrait orientation; default=8
Public Property Let MinPointSize(ByVal NewMinPointSize As Single) 
         'Get/Set minimum point size for portrait orientation; default=8
Public Property Get Orientation() As Integer      
         'Get/Set number of columns in page width
Public Property Get PageHeight() As Single        
         'Get/Set page height in inches; default=11
Public Property Let PageHeight(ByVal NewPageHeight As Single) 
         'Get/Set page height in inches; default=11
Public Property Get PageWidth() As Single         
         'Get/Set page width in inches; default=8.5
Public Property Let PageWidth(ByVal NewPageWidth As Single) 
         'Get/Set page width in inches; default=8.5
Public Property Get PointSize() As Single         
         'Get/Set point size to be used
Public Property Get Rows() As Integer             
         'Get/Set point size to be used
Public Function SetupReport(RptColumns As Integer) As Integer 
         'Set Printer for requested RptColumns
Public Function TitleLine(LeftText, CenterText, RightText) 
         'Return Text line of Columns characters constructed from Left,
         'Center, and Right segments
This site designed by William D. Kandler (bkandler@verisof.com)
Updated: 6/29/01