This is a migrated thread and some comments may be shown as answers.

Custom Print Button to RadWindow Titlebar - Only prints first page

1 Answer 104 Views
Button
This is a migrated thread and some comments may be shown as answers.
Amy
Top achievements
Rank 1
Amy asked on 21 Oct 2011, 05:32 PM
Could anyone offer any ideas as to why when using Firefox only the first page prints when using a custom print button on a RadWindow?

In my case two pages are printed, but only the first page has the text being printed and the rest of text that should appear on the second page isn't there. My print settings in Firefox are set to print the page #s and Date/Time in the footer, and these do appear on the second page so I know it's not just a blank sheet of paper printing.

If I use Google Chrome, the full text prints as expected on two pages (although the last line on the first page is only the top-half of the sentence and the first line of the second page is the bottom-half of the same sentence).

If I use IE, it prints exactly as it should...the full text prints as expected, and the last line on the first page is not cut-off and appears properly on the second page.

I really need this print functionality to work properly for Firefox as that is the browsers our users are told to use.  If nothing else, at least Chrome as we do sometimes suggest that as alternative.

Note - our code for adding the custom print button is taken from the Telerik article "Adding a Custom Button to RadWindow Titlebar" (http://www.telerik.com/support/kb/aspnet-ajax/window/adding-a-custom-button-to-radwindow-titlebar.aspx)

Thanks!

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Oct 2011, 12:03 PM
Hello Amy,

The KB article you linked offers the printing functionality as a bonus, its main concept is to show how to add buttons to the RadWindow's titlebar. The way this printing works is simply by calling the print() method of the document object of the iframe. This means that we have no control over the printing process and content - this is entirely up to the browser. What I can advise is that you try this code in a simple iframe (with appropriate dimensions, of course). It should produce the same result, as this is what the RadWindow uses.

You can also try the approach from this forum thread where printing is discussed. The difference is that you would need an additional function to get the HTML from the iframe, yet the results, I expect, will be the same, as the printing functionality comes from the browser, not from our controls.


Greetings,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Button
Asked by
Amy
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or