Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

105
Visualizações
gridview getting squished in the printout

I am trying to print the gridview using javascript. Gridview looks really nice on the web page, but when I try to print out the gridview, it gets squished. I can even see the outline of squished gridview. Below is the image of the gridview in the print out:

enter image description here

as you can see the outline of the gridview after $14.00. the lighter outline after $14.00 is the entire gridview, but in printout, it got squished. Below is the code for the printout:

<script>

        function printContent(el) {
               var restorepage = $('body').html();
               document.getElementById('<%=lblDateTime.ClientID %>').style.display = "block";
               document.getElementById('<%=lblDateTime.ClientID %>').innerHTML = 'Current Date Time: ' + new Date().toLocaleString();
       
               document.getElementById('<%=acrLogo.ClientID %>').style.display = "block";
               document.getElementById('<%=compName.ClientID %>').style.display = "block";
               var printcontent = $('#' + el).clone();
                printcontent.removeAttr('style');
               $('body').empty().attr('style', 'background-color: white;').html(printcontent);
                $('body').empty().html(printcontent);
                window.print();
                $('body').html(restorepage);
            }

</script>

How can I expand the gridview all the way to the line so that it doesn't get squished in the print out. below is the code of the gridview:

                              <div class="container">
                                  <div class="row justify-content-center">
                                    <div class="col-sm-6">
                                        <asp:GridView ID="grdCalculate" runat="server" GridLines="Horizontal" CssClass="table table-responsive table-hover table-striped table-bordered table-condensed" OnRowDataBound="grdCalculate_RowDataBound">
                                        </asp:GridView>
                                    </div>
                                </div>
                            </div>   

any help will be aprpeciated.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda