Forum  General Visual ...  How do I...?  How can I send Html Page to the Printer by using HtmlBox
Previous Previous
 
Next Next
New Post 1/4/2009 7:10 AM
  amir2407
3 posts
No Ranking


How can I send Html Page to the Printer by using HtmlBox 

Hi

I use HtmlBox to display Html pages , but I don't know how to send the Html Page , which is displayed by HtmlBox, to the Printer , to print it by a printer.

Can someone help me ?

Thanks

Amir

 
New Post 1/6/2009 11:12 PM
  ori.cohen
4383 posts
1st Level Poster




Re: How can I send Html Page to the Printer by using HtmlBox 
Modified By ori.cohen  on 1/7/2009 2:16:01 AM)

Hello Amir!

Welcome to Visual WebGui!

First you need to understand that the HtmlBox control is rendered to the browser window inside an IFrame HTML element. That means that it has it's own 'window' object.
You need to know the DOM path to this window object so you would be able to access it.

Once you found it, you could add a server-client invocation (explained in Appendix 1), and call the "window.print();" function on the window object of the HtmlBox.

If you want to print after clicking a button, and you don't require a server action for this Button Click event, you could use client-client invocation (explained here) to attach the call to the "window.print();" function to the "onclick" of the Button on client-side through server-side code.

Appendix 1 - Server-client invocation:
On the Form object call the method: this.InvokeMethodWithId. This method take two parameters:
1. The JavaScript code to be executed.
2. JavaScript function arguments to be used if in section 1 you had a single function call.
In section 1 you should write the DOM path to the HtmlBox's window object + "window.print();".

Regards,

Ori Cohen
Manager of support, the Visual WebGui team

 
Previous Previous
 
Next Next
  Forum  General Visual ...  How do I...?  How can I send Html Page to the Printer by using HtmlBox
CompanionKit Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS