Simberon.html Created by Dave Buck and enhanced by Chris Lopeman.
VisualWorks standard printing capabilities have long been weak. While Simberon Reports does not solve all printing issues at this time, it is a good start and a pretty solid base.
Reports can be generated to the screen (Pixmaps, files), to a postscript print (somewhat weak at this time), or to a Windows printer. Simberon uses a nice builder pattern to generate reports.
Below are links to three pages of an example report. You may need to zoom in in order to see how good they look.
Example Report Page 1
Example Report Page 2
Example Report Page 3
Simberon Reports includes the following features and more:
- Ability to easily create tabular reports. Tabular reports include the following:
- A based TabularReport class that provide a report that prints a Header (just a title) a Footer (Time and date and page numbers) and a body which is the table.
- Most Dataset Views can be printed as a tabular report in one line of code.
- Header row of the table in a report will print on each new page.
- Optionally, each column in a table is automatically sized to the right with based on the data in that column and the header.
- Tables can be set to just drop any columns that will not fit on the width of the page.
- Tables can automatically shrink the font used to display the data if it cannot fit on the width of the page. This is controlled by a list of fonts you provide.
- Proportional and fixed width columns can also be used.
- Each column can be set to align to right, left or center.
- Column headers are automatically centered.
- The data is provided as a simple Collection of Collections. Basically a table. Each entry is a cell. A cell can be a Number, String, Timestamp or any other object. Also, any report element can be in a table cell. This allows images in a cell, Image with text, lists, table-like constructs or anything you could build using the report elements
- Each column can have a standard format string applied for dates, numbers, etc...
- The table can be printed with our without a grid. However the headers are always gridded. The grid may have some off by one issues.
- Row Coloring and Numbering is supported. This includes a built in striping rule that can be used to alternate row colors for easy reading, even without a grid.
- The tabular report code is fairly well commented.
- Horizontal, Vertical and Depth stacks allow the stacking of elements in any direction. Allows pretty easy and detailed control over layout of your report. Depth Stacks allow layering of Report Elements, such as text over an image.
- Print images using printer resolution. This allows you to take a large image and scale it down for printing without loosing detail.
- Horizontal and vertical dividers are supported.
- Groups of elements can be "Kept Together" so that the are forced to be on one page.
- Includes examples of various types of reports.
- Several convenience methods are supported for sending reports tot a printer and even handling the user interface for picking the printer and dealing with common exceptions.
Things being worked on (move items here when you are taking on a task):
- Changing use of ComposedText to take rendering device into account. - CDL 9/18/2007
- Fixing text coloring issue. - CDL 9/18/2007
Things that need to be done:
- Improve builder to build report structure without pagination that could then be paginated an rendered against a chosen medium.
- Repair postscript printing issues.
- Improve the grid drawing to connect the lines better.
- Prettier grids....3D.
- Shorthand methods for laying out lines of text in boxes in a table like formatted, but not with even columns.
- Composed text needs to be enhanced to calculate width based on a graphics context. This would help more than this printing tool.
- Currently works based on pixel size fonts versus point sized fonts. Needs to be changed. I think this is causing the preview to be far too small and unreadable. I saw some interesting CLS posting that could help with this.
- Cleanup up bounds, pad, and margins in the package. Seems very redundant.
- Allow programmer to specify scaling of images in points, inches or centimeters.
- Shrink images with rest of table during auto-size.
- Database integration.
- Write test cases that work and pass. Most test cases in the base package failed for me, even though most appear to work.
- Create a better report previewer. I wonder if the standard Windows print dialog provides some sort of default preview these days we would tie into.
- The frames around elements off slightly because of the thinness of lines and how they are drawn for the right land bottom side of a boxes. This should be fixed by changing to the scale of the line thickness and repositioning the line for the right and bottom edges of boxes.
- Most elements (such as images) should be able to be allowed to have an alignment Currently only text is alignable.
- Try to keep together feature should be added to allow a group of elements to be kept together unless they will not fit on an empty page.
- Add your ideas...
Known Issues:
- There is a know issues when printing from Windows 2000 client to a Windows 2000 server using host printing and the print driver on the server and switching to landscape mode when the printer is not set for landscape. This is a know Windows issue and not restricted to VW or Simberon. The pages are sort of printed in a stretched landscape/portrait monstrosity. There are several ways to avoid this.
- There is an issue where Windows will not set landscape based on the selected printer. It will set it based on the default for the default printer. This can be reproduced in Notepad and is only an issue when there are multiple printers and you are not using the default printer and the printer being use has a different default orientation from the default printer's orientation.
You can thank Northrop Grumman for paying for releasing this code for
public use. Of course if there are improvements they would like to
see those improvements released back to the public. And of course
thank Dave for creating a great add-on in the first place.