Eiffel Reporting Library

21 views
Skip to first unread message

Larry Rix

unread,
Oct 19, 2018, 1:39:01 PM10/19/18
to Eiffel Users
Hi All,

I tried to resurrect the epdf library, but to no avail. There is just too much I do not understand. So—I decided that I still wanted an easy way to create pretty-reports in Eiffel using a common output target of PDF. The new library I have on github and at iron is a few steps in that direction.




HISTORY
=======
Back when we were in Atlanta, GA, the team there (Neal Lester) created a library for report generation that was very complex with lots of moving parts. Nevertheless—the reports that were produced were very pretty and turned out well. However, that code has a lot of complex dependencies that I'd rather not deal with and do not want others to deal with either. Because of this, I started hunting for an easy way to generate pretty reports using common things already available.

jsreport
----------
I found a system called "jsreport" (follow the link). This was all well and good, but I soon realized that this was another very complex solution with some serious limitations.

  • Javascript—the library is highly dependent on js and is really an HTML5-CSS3-to-PDF converter using Chrome in "headless" mode (or phantompdf).
  • Computations—the library wants to place computations in javascript away from the Eiffel code. This ought to raise your hackles because you now have code that your Eiffel compiler cannot verify making computations (and possibly with bugs).
I could never get the jsreport solution to work beyond very basic outputs, so I decided to scrap it and take another look at PDF.

PDF
------
I went looking for the specifications for PDF files. Such specs are easily available (and others too). Utilizing one such specification document, I set about seeing if I could create Eiffel classes that would allow me to quickly and easily generate well-formed PDF documents. My first round of code seems to be successful (I will let you help me judge that effort for yourself and provide feedback).

Does this code do-it-all? Nope. Not by a long stretch. This will be an ongoing effort on my part to make this more and more sophisticated as we move along. That effort will happen along two planes:

  1. Horizontally—building out more and more classes which implement more and more of the ISO PDF specification, complete with tests to both prove they work and prove they cannot be broken (easily or generally).
  2. Vertically—building out higher level classes to allow you (the library reuse-consumer) to easily use the high-level library code to quickly make pretty reports as PDF documents directly in Eiffel!
Both efforts will be a step-wise effort. As such, I DO NOT recommend that you get this library and start "using it". No no! Getting this library and opening it up will be to give feedback to me as I go.

Moreover—there is nothing but Eiffel code in this library. There are no other dependencies. Nothing external you need to "hook-up". There is no C/C++ code involved. This is just pure, simple, in-your-face Eiffel code that you can see, explore, and have fun with (I hope).

CURRENT STATE
==============
The library currently is capable of making a very simple one-page PDF document that is Text-based only. No graphics, no encryption, no compression, no-frills at all!

My next efforts will be to add classes and features that expand this to multi-page reports (first) and then more expressive and straight-forward report generating, like:
  • Lines—giving the code a set of lines-of-text and having it produce one or more pages, exhausting the list of text lines it receives.
  • Paragraphs—give the code a set of paragraphs and (like lines) produce one or more pages, exhausting the list of paragraphs it receives.
  • Tables—give the code a 2-dim ARRAY (or other structure like it) and have it produce Text-only tabular output, across one or more pages.
  • Headers & Footers—provide code that will generate basic page headers and footers as one would basically expect on common reports.
Once I have these matters handled, then I will say that the library can be potentially used for basic text-only simple reports.

Beyond that will come adding basic vector and image graphics. After that will come more precisely control over text rendering and transformations, and so on.

From there—who knows. Not sure.

GOAL
=====
The goal is to provide Eiffel programs with an effective, quick, simple, easy way to produce common reports from Eiffel data objects.

What I will never do?
  • Data-binding: That is not the job of a report generator. That is the job of whatever code is providing the source material for the report. it is another matter completely. Don't expect me to do it (perhaps in a companion library).
  • Computations: That also is not the job of a report generator. It's job is to take what it gets and render it to a PDF file. Period.
  • Other Generation: This library will generate to PDF only and nothing else. If you want something else, then this library will not be that library.

Larry Rix

unread,
Oct 19, 2018, 1:51:47 PM10/19/18
to eiffel...@googlegroups.com
I cannot say enough about the lack of complex dependencies!

Just about every other reporting solution I could find came with a whole host of complex dependencies. Folks might be mesmerized by "stacks" of technologies, which might make people feel "special" because they understand how to "hook-it-all-up-and-make-it-work". Meanwhile, I'd rather have a single stack (Eiffel), plug in the library, and just use it.


williams Lima

unread,
Oct 19, 2018, 2:07:55 PM10/19/18
to Eiffel Users
Looks like a big (and important) project. 

regards
Williams

Larry Rix

unread,
Oct 21, 2018, 12:41:34 PM10/21/18
to Eiffel Users
First look video can be found here.

The library is creating its first simple text-only multi-page PDF documents with just a few simple instructions!

BE AWARE:
==========
  • Bad BBox issue—if one uses multiple fonts, then there will be a bad bounding box issue. I need to figure out why and resolve it. Otherwise—if you use just one font (in any number of sizes), then you won't have this issue.
  • Clipping—if the line of text exceeds the width of the page, the text will be clipped (i.e. not "wrapped" to the next line). So, using the code as-is (now) will require ensuring text in a font at a point size is not larger than the width of the page
  • Orientation—the pages are presently only in portrait mode (not landscape) and no orientation mixing is possible
  • Sizing—presently only US 8 1/2 x 11 inch sizing is supported (i.e. MediaBox is 612 x 792 pixels)
YET TO COME
============
  • Fixing Bad BBox
  • Providing for line-wrapping
  • Providing for multiple orientations
  • Providing for multiple page sizing (dimensions)
All of these issue are moderately simple to handle, except perhaps the BBox issue (that's a head scratcher at the moment).

Larry Rix

unread,
Oct 21, 2018, 12:48:40 PM10/21/18
to Eiffel Users
There was an issue uploading new archive to IRON:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webm...@eiffel.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Reply all
Reply to author
Forward
0 new messages