Monday, March 26, 2012

Printing TabContainer

Hi there!

Just wondering if anyone has managed to achieve the following:

I've got a page with a TabContainer in it... and I want to print it. By default the printed page will show the tab container just as it appears on screen.
But that's not what I want!!
I want to the printed page to reflect the contents of the TabContainer e.g.

Tab1

Tab1's contents get rendered

Tab2

Tab2's contents get rendered

etc. etc.

I've had a brief look at how to accomplish this, but am realising this is probably going to take a fair bit of time and effort to do. So I was wondering if anyone had "done the work for me" and I could crib a solution together!!!

Now I suppose you want to know why I want to do this... well basically I'm going to have 100's of pages containing tabs that my users can view. Despite the information being available on screen they love to print anything and everything off for their own records. I really don't want to end up 2 versions of every page... 1 for on screen display... and one made nice and pretty for printing purposes!!

My current thoughts are:

    Write an extender to hook into the beforeprint and afterprint events on the client to "pretty" everything up.

    Write some @dotnet.itags.org.media print and @dotnet.itags.org.media screen to maybe deal with the changes

    Probably my favourite option... write a control adapter for the TabContainer... this could look at a querystring parameter to determine if I am trying to render a printable version or not. If not, render as normal, otherwise change the output so that each TabPanel is visible and lined up vertically one after the other.

Any ideas/thoughts??

Cheers,

James

Hmmm... been thinking about this a fair bit more since I posted... I'm now convinced that the ControlAdapter route is the best.

I'm playing round with a solution that seems to work quite well (and thankfully took a lot less time than I originally anticipated).
Still got a few things to sort out though to make it look "right"!


[Ignore]


[Sorry ignore again]

No comments:

Post a Comment