Print hierarchy grid

6 posts, 0 answers
  1. Ron
    Ron avatar
    2 posts
    Member since:
    Jun 2012

    Posted 15 Oct 2012 Link to this post

    Hi,

    Is there  any way to print an hierarchy grid ?
    I didn't find any sample which does that.
    Thanks.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Oct 2012 Link to this post

    Hello,

     You can loop your items hierarchically and build RadDocument in the same way as in flat scenario. 

    Greetings,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Ron
    Ron avatar
    2 posts
    Member since:
    Jun 2012

    Posted 17 Oct 2012 Link to this post

    How can i build a rad document inside a rad document ?
    Can i get an example ?

    Thanks.
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Oct 2012 Link to this post

    Hi,

     You should not create a document inside document. You simply need to loop on your items hierarchically and create the document with appropriate table. 

    Kind regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Thomas
    Thomas avatar
    7 posts
    Member since:
    Feb 2015

    Posted 05 Aug 2015 Link to this post

    Hi,

     In Kendo hierarchy grid, loading appears while print the grid.

    Can you please help in removing it.

     

    Jquery for print,

    function printGrid(GridId, colToHide) { debugger

    var dataSource = $("#grid").data("kendoGrid").dataSource;
    dataSource.pageSize(dataSource.total());

    // Declaring Variables.
    var SCRIPT_REGEX = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;
    var cssUrl = "/(S(ww2x3porzqtoymwdvlhl3q5q))/Content/PrintSite.css";
    var grid2 = $("#grid").data("kendoGrid");
    var i;
    for (i = 0; i <= grid2.tbody.find('>tr.k-master-row').length-1; i++) {
    var parentId = grid2._data[i].ID;
    var childgridId = "#grid_"+parentId ;
    var gridView = $(childgridId).data("kendoGrid");
    if(gridView!=null)
    gridView.hideColumn(7);
    }

    var gridElement = $("#grid");
    win = window.open(

    '', '', 'width=800, height=500, scrollbars = 1'),
    doc = win.document.open(),
                          
                        htmlStart =

    '<!DOCTYPE html>' +
    '<html>' +
    '<head>' +
    '<meta charset="utf-8" />' +
    '<title>'+title+'</title>' +
    '<link href=' + cssUrl + ' rel="stylesheet" /> ' +
    '<style>' +
    'html { font: 11pt sans-serif; overflow: -moz-scrollbars-vertical; overflow-y: scroll;}' +
    '.k-grid, .k-grid-content { height: auto !important; }' +
    '.k-grid-toolbar, .k-grid-pager > .k-link, .k-pager-info, .k-pager-wrap.k-grid-pager.k-widget { display: none; }' +
    '.k-grid-content {overflow-y: hidden}' +
    'td {padding: 10px;}' +
    '</style>' +
    '</head>' +
    '<body>',
    htmlEnd =

    '</body>' +
    '</html>';
    var headerGridElement = $("#ReportDetailsGrid");
    var sectionPara = '<h4 style="margin:10px 0px 20px 5px;">' + "Field Collected Data" + '</h4>'
    var div = '<div style= "height:10px;"></div>'
    var fieldData = gridElement.clone()[0].outerHTML
    // Code used for removing the Jquery present inside the HTML.
    // On removing the script tag only child band will be retrived successfully.
    while (SCRIPT_REGEX.test(fieldData)) {
    fieldData = fieldData.replace(SCRIPT_REGEX,

    "");
    }

    doc.write(htmlStart + sectionPara + headerGridElement.clone()[0].outerHTML + div +
    fieldData+ htmlEnd);
    doc.close();
    win.print();

    var dataSource1 = $("#grid").data("kendoGrid").dataSource;
    dataSource1.pageSize(5);

    var gridView = $("#grid").data("kendoGrid");
    gridView.showColumn(2);
    }

     

    Attached the image while print.

    How to remove/make invisible loading text.

  7. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 06 Aug 2015 Link to this post

    Hi,

    Since the question seems to not be related to RadGridView for Silverlight, I would suggest you to post it in the respective forum category.

    Regards,
    Dimitrina
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner