blakew has asked for the wisdom of the Perl Monks concerning the following question:

I want to export formatted tables (for presentation, not data exchange) in a variety of formats, top of the list being Excel and Tex, but also HTML, pdf, image, ...

I can define my own Table class and write each individual export method in various formats using their idiosyncratic interfaces, but it would be nice if a standardized class (module?) existed so I could just conform to that and magically get multi-format exporting without the work. Ideally the class would be flexible enough to allow any custom formatting conceivable in HTML or Spreadsheet::WriteExcel based on instance-level configuration (S:WE is in general much broader than I need).

I'm aware of Data::Table for data but nothing so much for report-like tables. In case I'm being too vague by "table" I mean there's an underlying tabular data structure but with beautification - headers, text, custom formatting, etc etc.

In sum, I want all of LaTeX::Table, Spreadsheet::WriteExcel, PDF::Table, and whatever HTML/XML table writer of your choice but with a common interface. Is that too much (seriously :)?

  • Comment on Multi-Format Table Export - Seeking a Common Interface

Replies are listed 'Best First'.
Re: Multi-Format Table Export - Seeking a Common Interface
by zentara (Cardinal) on Feb 05, 2010 at 13:12 UTC
    I'm just speaking as a hacker here; but it seems to me you would be better off creating the pages in Excel, (or the biggest userbase out there, maybe PDF?), Then try to find programs that convert the excel to whatever else you may need. Google for "excel convert to other format" for ideas. Of course, you will then be stuck with possible glitches in ugly conversions. I'll bet the Adobe pay-for PDF writer software, acrobat does conversions to/from many formats, pretty well. :-)

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
      No, you're definitely right it would be reinventing the wheel, but I was hoping for an open Perl interface. Ah well, it doesn't even seem there's much interest in the matter, otherwise I might attempt something.