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

Print hierarchy grid

5 Answers 64 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 15 Oct 2012, 03:08 PM
Hi,

Is there  any way to print an hierarchy grid ?
I didn't find any sample which does that.
Thanks.

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Oct 2012, 08:42 AM
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.

0
Ron
Top achievements
Rank 1
answered on 17 Oct 2012, 09:28 AM
How can i build a rad document inside a rad document ?
Can i get an example ?

Thanks.
0
Vlad
Telerik team
answered on 17 Oct 2012, 10:40 AM
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.

0
Thomas
Top achievements
Rank 1
answered on 05 Aug 2015, 02:22 PM

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.

0
Dimitrina
Telerik team
answered on 06 Aug 2015, 07:19 AM
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
Tags
RichTextBox
Asked by
Ron
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Ron
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or