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

Getting Print event

1 Answer 154 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul Khinvasara
Top achievements
Rank 1
Rahul Khinvasara asked on 12 Dec 2007, 10:33 AM
Hi,
    In my project I have one telerik report viewer and two telerik text Editor. Right now for printing the report the user needs to click print button of respective control.
     I am using the telerik text editor for printing the data since telerik reporting tool does not supports html.
Now I want to have a common print button . On clicking it I  want to print text from report viewer , and text from 2 text Editor.
    The user will click on one button and the text from all the controls will get printed.
  For this I found the sample code from telerik forum  http://www.telerik.com/community/forums/thread/b311D-ctegm.aspx)
which suggests to use the following javascript function on print button:
<form id="Form1" method="post" runat="server">
 <script type="text/javascript">
 function printRTB()
 {
   var printIframe = document.createElement("IFRAME");
  document.appendChild(printIframe);
  var printDocument = printIframe.contentWindow.document;
  printDocument.open();
  
  var editorHolderDiv = document.getElementById("editorHolder");
  var theEditorContentHoder = editorHolderDiv.childNodes[0];
  printDocument.write(theEditorContentHoder.innerHTML);
  printDocument.close();
  printDocument.execCommand("Print");
  document.removeChild(printIframe);
 };
 </script>
 <div id="editorHolder">
 <rade:radeditor id="RadEditor1" editable="true" runat="server" saveinfile="false" haspermission="false">test test test</rade:radeditor>
 </div>
 <input type="button" id="btnPrint" OnClick="printRTB();" value="Print">
</form>


Can I print the data from report viewer using the above code?

Thanks,
Rahul

1 Answer, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 15 Dec 2007, 10:02 AM
Hello Rahul Khinvasara,

Please see this forum thread that we discussed a similar to your question.

Kind regards,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Rahul Khinvasara
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Share this question
or