Skip navigation.
 
mlRe: Printing Core Data
FROM : I. Savant
DATE : Tue Jul 25 20:02:07 2006

Unless you want to exactly print what's on screen, the best 
approach is to construct your own "print view" as you suspected. I 
wouldn't bother creating it in IB, just create it programatically.

  The best approach depends entirely on what you're trying to print. 
If you're only trying to print something in a table, you can of 
course print the table directly, but you get all the widgets (like 
shiny column headers, any controls you have, etc).

  To do it "right" (ie, you want options, formats, etc.) you should 
create a custom view that lays the data out properly (or according to 
user options, whatever you like), then print it.

  To *really* get complicated, you can use PDFKit and create a fully-
formated document. This may be preferable if you're going to be 
generating anything exceedingly "pretty" (such as a well-formatted 
report-style printout). You could alternatively use a web view from 
WebKit along with some on-the-fly HTML and a style sheet. It might be 
easier for you.

  Again, it entirely depends on what you're trying to accomplish. 
Start out small, learn the basics, then expand. :-)

--
I.S.


On Jul 25, 2006, at 1:50 PM, Stefan wrote:

>
> OK, then let me rephrase: Should I create a new window in IB, drop a
> special printer formatted table to the window and assign this to the
> print operation?
>
> Or should I create a NSView somehow programmatically and subclass its
> draw method?
>
> I inspected your link already and the code works fine. But now, I 
> need to
> link this to the content in certain parts of my current document/
> window.
>
> Sorry to be not very precise. I do search the correct entry point...
>
>
> Am 25.07.2006 um 19:43 schrieb I. Savant:
>

>>
>>  This really has nothing at all to do with Core Data. As long as 
>> you know how to retrieve the data you want to print, all the 
>> standard printing tutorials still apply.
>>
>>  I recommend giving the following a good read, if you haven't 
>> already:
>>
>> http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/
>> index.html#//apple_ref/doc/uid/10000083i
>>
>>
>> --
>> I.S.
>>
>>
>> On Jul 25, 2006, at 1:33 PM, Stefan wrote:
>>

>>> After a while, I'm back on the cocoa list - and started to love
>>> Core Data.
>>>
>>> My first little app based on Core Data work fine, but doesn't print.
>>> I managed to prepare a printer context and print a screen view, 
>>> actually
>>> a NSTableView. Naturally, this doesn't look very nice.
>>>
>>> Thus I'd like to find a tutorial, which explains how to map my 
>>> ArrayController's data
>>> to  a 'printer-targeted' view and print it.
>>>
>>> Do we have any special Core Data related printing features? E.g. 
>>> I could imagine a
>>> 'print-window' which then gets sized to the printer some way.
>>>
>>> Any pointer regarding the best practice approach?
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Cocoa-dev mailing list      (<email_removed>)
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
>>> 40gmail.com
>>>
>>> This email sent to <email_removed>

>>

>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
> 40gmail.com
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlPrinting Core Data Stefan Jul 25, 19:33
mlRe: Printing Core Data I. Savant Jul 25, 19:43
mlRe: Printing Core Data Stefan Jul 25, 19:50
mlRe: Printing Core Data I. Savant Jul 25, 20:02
mlRe: Printing Core Data Stefan Jul 26, 00:07
mlRe: Printing Core Data Chris Hanson Jul 26, 01:18
mlRe: Printing Core Data Stefan Jul 26, 23:20