Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Splitter > Print RadPane

Not answered Print RadPane

Feed from this thread
  • Posted on Jan 11, 2012 (permalink)

    I just want to print the content in the radpane. I tried options provided in other thread but getting error. There are links in those threads which are erroring out. I like know the right way/ right javascript code to do print with any scripts which needed to be included to get it working.

    Below is my code
    <script type="text/javascript">
        function PrintPane(paneID)
        {
          var splitter = <%= RadSplitter1.ClientID %>;
          alert(paneID);
          var pane = splitter.GetPaneById(paneID);
          if (!pane) return;
          pane.Print();
        }
    </script>

    Reply

  • Kevin Master avatar

    Posted on Jan 11, 2012 (permalink)

    Hello Vijaianand,

    I don't know if this is causing your issue, but with javascript being case-sensitive. The method call, GetPaneById, should be getPaneById.

    Reply

  • Posted on Jan 12, 2012 (permalink)

    Hello,

    Take a look into the following documentation.
    Printing Pane Content

    Thanks,
    Princy.

    Reply

  • Posted on Jan 12, 2012 (permalink)

    Hello

    @Kevin, all the examples in the forum gives GetPaneById only. So thats why I am using it.
    @Princy, Please read my question with the code. I already have the code but trying to say its not working.  It is giving object not find on GetPaneById

    Reply

  • Posted on Jan 12, 2012 (permalink)

    Actually, i made a mistake in find the splitter client id, I fixed that line
    var splitter = $find('<%=RadSplitter1.ClientID %>');

    No error now. but still printing is not working. It just not doing anything at the end. 

    Reply

  • Dobromir Dobromir admin's avatar

    Posted on Jan 12, 2012 (permalink)

    Hi Vijaianand,

    According to the error, that you have already noticed yourself, I believe the examples that you have found are for RadSplitter Classic, that is why the GetPaneById() and Print() methods are capitalized, but this should not be the problem because RadSplitter for ASP.NET AJAX have those methods too.

    I tried the sample from the help article that Princy linked and I was able to to print the panes content without any errors. For your convenience I have attached my sample page, could you please modify it to a point where the problem occurs and send it back?

    In addition, in your initial post you are mentioning dead links - "There are links in those threads which are erroring out". Could you please point those thread so we can try to provide the correct links (if possible).

    Greetings,
    Dobromir
    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
    Attached files

    Reply

  • Posted on Jan 12, 2012 (permalink)

    Hi

    Actually its not RadPane, its RadSlidingPane. So I am not sure that may be the issue. Is it possible print slidingpane? I thought it should be same as RadPane.
    There are lots of dead links you can find when you and search for "RadPane Printing" in the form.

    Vijai

    Reply

  • Dobromir Dobromir admin's avatar

    Posted on Jan 12, 2012 (permalink)

    Hi Vijai,

    RadSlidingPane does not offer the possibility to print its content out-of-the-box, nevertheless, you can use the following function to achieve the required result:
    function printSlidingPaneContent(slidingPaneId, arrCssFiles)
    {
        var sPane = $find(slidingPaneId);
        var sFeatures = 'width=' + sPane.get_width() + 'px, height=' + sPane.get_height() + 'px, scrollbars=1';
        var previewWndUrl = 'about:blank';
        var previewWnd = window.open(previewWndUrl, '', sFeatures, false);
     
        //CSS files to be included in the popup window
        var styleStr = "";
        if (arrCssFiles) {
            styleStr = "<head>";
     
            for (var i = 0, length = arrCssFiles.length; i < length; i++) {
                styleStr += "<link href = '" + arrCssFiles[i] + "' rel='stylesheet' type='text/css'></link>";
            }
            styleStr += "</head>";
        }
     
        var popupContent = styleStr + "<body>" + sPane.getContent() + "</body>"
     
        previewWnd.document.open();
        previewWnd.document.write(popupContent);
        previewWnd.document.close();
     
        previewWnd.print();
    }

    For your convenience I have attached a sample page demonstrating this approach.

    Greetings,
    Dobromir
    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

    Reply

  • Posted on Jan 12, 2012 (permalink)

    That works except the height and width from Slidingpane is properly getting it. It set to Min width and height..

    Thanks. May be should have searched for SlidingPane print instead of RadPane. 

    Reply

  • Posted on Feb 15, 2012 (permalink)

    Hi

    I am having issue with this solution when the RadSlidePane has iframe. It is not taking iframe content to print. How can we fix that issue? I was thinking may be take the content of the page which is iframed and add in the popcontent but I was wondering any other solution possible.

    Vijai

    Reply

  • Dobromir Dobromir admin's avatar

    Posted on Feb 20, 2012 (permalink)

    Hi Vijai,

    In general, the printing functionality is controlled by the browser and the OS and cannot be modified programmatically.

    RadSplitter does not offer the functionality to display external content inside its sliding panes, and does not offer functionality to access the content of <iframe> elements out-of-the-box.

    If you are using an <iframe> to display external content inside RadSlidingPane you need to manually extract the content of this <iframe> and add it to the preview's popup window. However, accessing the content of an <iframe> element is not always possible because of a security restriction in JavaScript - you cannot access content of an <iframe> if the page displayed inside it is from different domain.

    Regards,
    Dobromir
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Posted on Feb 21, 2012 (permalink)

    ok! I know RadSplitter don't support print and thats why I am trying different ways.

    So if I understand correctly, I won't be to able to extract content from iframe if the url is from different domain but if its same domain it is possible? I tried many ways using javascript, jquery to extract it out but still no luck. Do you have any code sample?

    Reply

  • Dobromir Dobromir admin's avatar

    Posted on Feb 24, 2012 (permalink)

    Hi Vijai,

    Please review the following RadEditor's Demo.
    http://demos.telerik.com/aspnet-ajax/editor/examples/customdialogs/defaultcs.aspx

    The custom PrintPreview dialog is using an IFrame and prints its content.

    Regards,
    Dobromir
    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.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Splitter > Print RadPane
Related resources for "Print RadPane"

ASP.NET Splitter Features   |  Documentation   |  Demos  |  Telerik TV   |  Self-Paced Trainer   |  Step-by-step Tutorial  ]