I haven't tried it myself, but you should be able to use AWT's built in print 
functionality to get a Graphics2D object representing your printer and then 
just draw to it (e.g. by calling the paint() method of your root component). 
You may need to apply a scaling transform to get reasonable results, and, as 
Noel said, you may need to watch out for animations if you are trying to print 
any components that use them. Since we don't currently provide a way to turn 
animations off, I'd suggest avoiding such components if you can.

Another alternative is to use a reporting package (such as JasperReports) to 
perform your report rendering. If I were writing a Pivot-based reporting tool, 
I think I would probably look at this option first.

G

On Nov 25, 2009, at 5:27 AM, Noel Grandin wrote:

> Swing manages to do this with reasonable results.
> It essentially passes a custom Graphics2D object through the painting
> pipeline.
> The custom Graphic2D operates at printer resolution.
> 
> However, there are various pitfalls, including disabling animations, etc.
> And it tends to flush out more latent painting bugs, because the printer
> has an effective screen grid of something like (0,0) to (70000, 250000).
> 
> So it's something that we could probably support, but it would need some
> work.
> 
> -- Noel.
> 
> Niclas Hedhman wrote:
>> On Wed, Nov 25, 2009 at 6:00 PM, Sandro Martini
>> <[email protected]> wrote:
>> 
>>> Hi to all,
>>> I have to prototype a simple Reporting application with Pivot, but one
>>> of the requirements is to Print the data viewed (in same same way as
>>> presented, and maybe also in a different way).
>>> 
>>> Someone has already tried this ?
>>> Suggestions/problems/pitfalls/comments ?
>>> 
>> 
>> Typical pitfall; Screen resolution and printer resolution are
>> typically very different, and since AFAIK Pivot operates on pixels,
>> this could become a major headache especially in combination with
>> pixel graphics (if any).
>> 
>> 
>> Cheers
>> 
> 

Reply via email to