Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Reporting functionality?

90 views
Skip to first unread message

Robert

unread,
Jul 24, 2017, 2:37:35 PM7/24/17
to
Perl comes with "perlform": http://perldoc.perl.org/perlform.html

From the description: Perl has a mechanism to help you generate simple reports and charts. To facilitate this, Perl helps you code up your output page close to how it will look when it's printed. It can keep track of things like how many lines are on a page, what page you're on, when to print page headers, etc. Keywords are borrowed from FORTRAN: format() to declare and write() to execute; see their entries in perlfunc. Fortunately, the layout is much more legible, more like BASIC's PRINT USING statement. Think of it as a poor man's nroff(1).

Does Tcl have something similar to this?

Thanks,

Bob

mango

unread,
Jul 24, 2017, 6:51:12 PM7/24/17
to
Wow what a fascinating piece of Perl line noise, complete with Fortran nostalgia!

I'm not aware of anything quite like that in the Tcl world. The "doctools" packages in tcllib might be as close as you can get and what I use when I produce package documentation (usually as separate files processed by dtplite).

Andrew Mangogna

joheid

unread,
Jul 25, 2017, 4:02:54 AM7/25/17
to
Ok, language war :-) . Producing nice documents is LaTeX-land, and data aggregation and visualisation is R-land. The R package knitr (https://yihui.name/knitr) combines these two tools, which allows automated document production. An example can be found at https://www.thru.de/fileadmin/SITE_MASTER/content/Dokumente/Berichte/2017-03-21_Schadst_im_PRTR_2007-2015_Branchen_ENG.pdf .

--
Dr. Joachim Heidemeier
German Environment Agency

Matthew Hiles

unread,
Jul 25, 2017, 8:00:40 AM7/25/17
to
Not exactly what you asked, but I figured it's worth pointing out: You can programmatically produce output using the text widget in Tk and then dump it out as a PDF.

pal...@yahoo.com

unread,
Jul 25, 2017, 8:14:03 AM7/25/17
to
Well, there is the report module in tcllib which may or may not meet your needs. It is slightly awkard to use as it depends on data being structured using the struct::matrix package, also from tcllib.

Alternatively, there is the simpler, but a little less functional, tabulate package at http://wiki.tcl.tk/41682 which may also suffice.

/Ashok

Gerald Lester

unread,
Jul 25, 2017, 8:48:10 AM7/25/17
to
> On Tuesday, July 25, 2017 at 12:07:35 AM UTC+5:30, Robert wrote:
>> Perl comes with "perlform": http://perldoc.perl.org/perlform.html
>>
>> From the description: Perl has a mechanism to help you generate
simple reports and charts. To facilitate this, Perl helps you code up
your output page close to how it will look when it's printed. It can
keep track of things like how many lines are on a page, what page you're
on, when to print page headers, etc. Keywords are borrowed from FORTRAN:
format() to declare and write() to execute; see their entries in
perlfunc. Fortunately, the layout is much more legible, more like
BASIC's PRINT USING statement. Think of it as a poor man's nroff(1).
>>
>> Does Tcl have something similar to this?
>>
On 07/25/2017 07:13 AM, pal...@yahoo.com wrote:
> Well, there is the report module in tcllib which may or may not meet your needs. It is slightly awkard to use as it depends on data being structured using the struct::matrix package, also from tcllib.
>
> Alternatively, there is the simpler, but a little less functional, tabulate package at http://wiki.tcl.tk/41682 which may also suffice.

Generally, for "simple" reports I find most people want a spreadsheet --
so I use the csv package from TclLib to produce one.

The rare times when someone wants something more, I either use the
technique you suggest with a Canvas or the PDF direct package.

For really fancy reporting, there is always output to LaTex.


--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

Gerald Lester

unread,
Jul 25, 2017, 8:52:01 AM7/25/17
to
Lines per page???

It sounds like your reports are "lineprinter" style reports and not the
HTML or PDF or "laser printer" style reports (i.e. where text can be in
multiple fonts of different sizes to that there really is no such things
as lines on a page -- only space on a page) that most people seem to
want if they do not want a spreadsheet. As another post has pointed
out, there is a reports package in TclLib.

Robert

unread,
Jul 25, 2017, 4:03:36 PM7/25/17
to
I only copied that out. I don't really need lines per page. I just want to present something on the console that is formatted nicely.

I am looking at the reports package and the link Ashok gave.

Thanks everyone. Trying to move all my "higher level scripts" solely to Tcl.

--
Bob

Gerald Lester

unread,
Jul 25, 2017, 5:12:32 PM7/25/17
to
Oh, if you don't need page headers and footers (which lines per page
implies) -- then maybe the format command is all you need.

Robert

unread,
Jul 25, 2017, 6:02:03 PM7/25/17
to
Looking at that now too. Thanks Gerald.

Bob

mango

unread,
Jul 25, 2017, 6:03:46 PM7/25/17
to
For just simple text adjustments, the ::textutil::adjust package in tcllib does a nice job. I use it to make nicely adjusted paragraph outputs. Might work for you.

Andrew Mangogna
0 new messages