I am using a hierarchical data in a web form with 4 nested levels.
I have created a nested GridView. It displays well. But, now i need to print this GridView. I tried this code
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript" language="javascript">
- function CallPrint(strid) {
- var prtContent = document.getElementById(strid);
- var WinPrint = window.open('', '', 'letf=0,top=0,width=400,height=400,toolbar=0,scrollbars=0,status=0');
- WinPrint.document.write(prtContent.innerHTML);
- WinPrint.document.close();
- WinPrint.focus();
- WinPrint.print();
- WinPrint.close();
- return false;
- }
- </script>
--
Expand|Select|Wrap|Line Numbers
- <input type="button" value="print " id="btnPrint" runat="Server" onclick="javascript:CallPrint('divPivot1')" />
--
It works well.
But, It opens the print dialog box. And i am not able the resize the print window.
can anyone please tell me how to customize dialog and how to show a print preview. Because i need to do more formatting based on the preview. Because, i want to make sure that the nested grids all appears intact, without any irregularities and without any formatting errors.
Please reply as soon as possible. Thanks!