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

Disabled UseStaticHeader when Print

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Estudios-Electricos
Top achievements
Rank 1
Estudios-Electricos asked on 01 Dec 2015, 12:51 PM

I tried to disable UseStaticHeader when Print a Grid

this is my js function

 This works OK, but when I use StaticHeader not all data display. Please see attached image

  function Imprimir() {
                    var radGrid = $find('<%= grillaListado.ClientID %>');                    
                    radGrid.MasterTableView.get_element().style.fontSize = "10px";
                    debugger;
                    radGrid.MasterTableViewHeader.get_element().style.fontSize = "10px";
                    var previewWnd = window.open('about:blank', 'Resúmen Ordenes de Pago', '', false);
                    var styleStr = "<html><head><title>Resúmen Horas de Proyectos</title></head>";
                    var fechaDesde = $find('<%= dtFechaDesde.ClientID %>').get_textBox().value;
                    var fechaHasta = $find('<%= dtFechaHasta.ClientID %>').get_textBox().value;
                    var htmlcontent = styleStr + "<body> <label style='font-size:10px'>Fecha desde:" + fechaDesde + " - hasta " + fechaHasta + "</label><br>" + radGrid.get_element().outerHTML + "</body></html>";
                    previewWnd.document.open();
                    previewWnd.document.write(htmlcontent);
                    previewWnd.document.close();
                    previewWnd.print();
                    previewWnd.close();
                }

  function Imprimir() {
                    var radGrid = $find('<%= grillaListado.ClientID %>');                    
                    radGrid.MasterTableView.get_element().style.fontSize = "10px";
                    radGrid.MasterTableViewHeader.get_element().style.fontSize = "10px";

/********************* I TRIED THIS ***************************/

radGrid.ClientSettings.Scrolling.UseStaticHeaders =false;   => does not work

/********************* I TRIED THIS ***************************/
                    var previewWnd = window.open('about:blank', 'Resúmen Ordenes de Pago', '', false);
                    var styleStr = "<html><head><title>Resúmen Horas de Proyectos</title></head>";
                    var fechaDesde = $find('<%= dtFechaDesde.ClientID %>').get_textBox().value;
                    var fechaHasta = $find('<%= dtFechaHasta.ClientID %>').get_textBox().value;
                    var htmlcontent = styleStr + "<body> <label style='font-size:10px'>Fecha desde:" + fechaDesde + " - hasta " + fechaHasta + "</label><br>" + radGrid.get_element().outerHTML + "</body></html>";
                    previewWnd.document.open();
                    previewWnd.document.write(htmlcontent);
                    previewWnd.document.close();
                    previewWnd.print();
                    previewWnd.close();
                }

 

 

How i can print the complete grid when it use StaticHeader?

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 04 Dec 2015, 01:34 PM
Hello,

You can disable grid scrolling with static headers using the following highlighted css:
<script type="text/javascript">
                function Imprimir() {
                    var radGrid = $find('<%= grillaListado.ClientID %>');
                    radGrid.MasterTableView.get_element().style.fontSize = "10px";
                    debugger;
                    radGrid.MasterTableViewHeader.get_element().style.fontSize = "10px";
                    var previewWnd = window.open('about:blank', 'Resúmen Ordenes de Pago', '', false);
                    var styleStr = "<html><head><style type='text/css'>.rgDataDiv{overflow: auto !important;height: auto !important;}</style><title>Resúmen Horas de Proyectos</title></head>";
                    var fechaDesde = $find('<%= dtFechaDesde.ClientID %>').get_textBox().value;
                      var fechaHasta = $find('<%= dtFechaHasta.ClientID %>').get_textBox().value;
                    var htmlcontent = styleStr + "<body> <label style='font-size:10px'>Fecha desde:" + fechaDesde + " - hasta " + fechaHasta + "</label><br>" + radGrid.get_element().outerHTML + "</body></html>";
                    previewWnd.document.open();
                    previewWnd.document.write(htmlcontent);
                    previewWnd.document.close();
                    previewWnd.print();
                    previewWnd.close();
                }
            </script>


Regards,
Pavlina
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
Grid
Asked by
Estudios-Electricos
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or