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

[Solved] Print the Grid Content

0 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pankaj
Top achievements
Rank 1
Pankaj asked on 03 May 2013, 08:37 AM
hi ,

i have issue of print problem i am using a rad grid gvReportUnit and a print button
the grid is filled by run report button on click of print button the code is 

  btnRunReport_Click(nullnull);
   RadAjaxPanel1.ResponseScripts.Add("PrintRadGrid('" + gvReportUnit.ClientID + "')");
       

and on aspx page

 function PrintRadGrid(radGridId) {
                var radGrid = $find(radGridId);
                var previewWnd = window.open('about:blank'''''false);
                var sh = '<%= ClientScript.GetWebResourceUrl(gvReportUnit.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",gvReportUnit.Skin)) %>';
                var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
                var htmlcontent = styleStr + "<body>" + radGrid.get_element().outerHTML + "</body></html>";
                previewWnd.document.open();
                previewWnd.document.write("<b><center>Custom Report</center></b>");
                previewWnd.document.write(htmlcontent);
                previewWnd.document.close();
                previewWnd.print();
                previewWnd.close();
            }
it is opening a new window for print instead of opening a new window it should open a print pop up in which grid data should be filled in print popup Pankaj

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Pankaj
Top achievements
Rank 1
Share this question
or