is printing tabular data really that annoying?
is printing tabular data really that annoying?
- Subject: is printing tabular data really that annoying?
- From: "Jim Thomason" <email@hidden>
- Date: Thu, 18 Jan 2007 09:33:08 -0600
I know that this has been asked dozens of times, but I never really
found a good answer, so I'll ask again and hope for something
definitive.
Is it really that much of a pain in the butt to print out my tabular
data (currently displayed in an NSTableView)?
Wiring up the tableview to display is so simple. Bindings, coredata,
all sorts of wonderful things make the data basically flow forth to
the screen w/o any effort. But printing it? In perusing the archives,
I've found such tidbits as:
* you can print the table view "for free" by telling it to print:, but
you don't get the headers, it doesn't size for your page
automatically, and the pages will happily break in the middle of
cells.
* There was a small suggestion to place the tableview inside a
different view (or resize its NSScrollView) to fit the page, but no
elaboration.
* Several places suggest creating your own custom view, with all the
fancy layout, meticulous string placement, drawing of boxes, and so
on. While I'm not going to deny this would be pretty, it sure is an
awful lot of work.
* The most popular suggestion seems to be creating an HTML string and
using webkit to render and print it. Pagination is still glossed over,
including multiple header rows, but that can probably be dealt with (I
assume. I haven't fiddled with WebKit much).
And I'm just amazed that it's this much effort. The tableview displays
easily on the screen, and cocoa's printing is just drawing the same as
you would to the screen, but sending to a different device, right? So
surely there's a better way, right?
Some set of bits to flip in NSTableView to resize to the page, keep
the headers, properly break on pages? And, if so, a few pointers to
them?
Or is the only way to go to create a new custom printable table view,
or render it in HTML and fiddle with stylesheets and page breaks
there?
Any recommendations highly appreciated, preferably with some snippets
(at least some pseudocode to get me started).
Thanks much,
-Jim......
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden