Click here to Skip to main content
15,899,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,


in my page i have two dropdown field above gridview,while printing time it should print as label format in javascript.....


please help me
Posted

1 solution

Now, you just want to print it (no PDF scenario)! :doh: (& no effort shown yet!)

Using JavaScript, try something like:
JavaScript
function CallPrint()
{
  var printContent = document.getElementById('<%= pnlToPrint.ClientID %>');
  var printWindow = window.open("", "Print Panel", ‘left=50000,top=50000,width=0,height=0′);
  printWindow.document.write(prtContent.innerHTML);
  printWindow.document.close();
  printWindow.focus();
  printWindow.print();
  printWindow.close();
}

HTML
<div runat="server" id="pnlToPrint" >
  <table>
    <tr>
      <td>
         Your data
      </td>
    </tr>
  </table>
</div>

<input type="button" value="Print"  onclick="CallPrint();" />
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900