Skip to Content
We talked about some of these issues in the Business Server Pages (BSP) but have you ever really sat down to think about how you are going to print out some content?

Well as you can see by doing a search here on SDN we’ve covered a similiar topic.

What I would like to do is share some of the options we found.


The first option of course is to take your chance and let the user print the page out of their browser and hope for the best.  This of course can easily be accomplished by adding a simple image image ( ‘ICON_PRINT’ it’s a icon available in the system ) to your page and activate a javascript command called window.print().

The problem with using this command is 1) they get what the browser gives and 2) it may not work across every browser. For that reason I searched and came across a script.

‘);
}

Just copy that script into the body of the page and of course place the link where you like and you are set to go.

This still does not solve our problem of having to accept what the browser gives us or making the user manually alter the page layout in order to get all of the data horizontally on the page.


So let’s take a look at a way to get Internet Explorer (IE) to switch to Landscape instead of Portrait. Quite simply you define a style and surround the code of your Page Layout in a DIV tag.
Now of course the nice enhancement to this would be to go through this BSP/HowTo: Generate PDF Output from a BSP. and build your “printerversion.doc” page or at least the name there dynamically.
For the code on how to generate a printable version simply go to this BSP/HowTo: Generate PDF Output from a BSP. and follow the information there for the option that is best for you. You can of course also generate a new HTML page that simply displays all the data.

Some of you may be wondering why go to the trouble, well from that link I provided in the beginning you will see that some of the BSP Elements do not print out very well and therefore sometimes another solution is needed.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Durairaj Athavan Raja
    if you have frame and wish to print the frame contents from outside the frame (or from other frame) just use the following javascript.

    [code]
    function Printframe()
    {
    frames[“frameName”].focus();
    frames[“frameName”].print();
    }

    [/code]

    Regards
    Raja

    (0) 

Leave a Reply