473,398 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

print datagrid in asp.net

12
Hi,

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
  1.   <script type="text/javascript" language="javascript">
  2.       function CallPrint(strid) {
  3.           var prtContent = document.getElementById(strid);
  4.           var WinPrint = window.open('', '', 'letf=0,top=0,width=400,height=400,toolbar=0,scrollbars=0,status=0');
  5.           WinPrint.document.write(prtContent.innerHTML);
  6.           WinPrint.document.close();
  7.           WinPrint.focus();
  8.           WinPrint.print();
  9.           WinPrint.close();
  10.           return false;
  11.       }
  12.   </script>

--
Expand|Select|Wrap|Line Numbers
  1. <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!
Dec 5 '11 #1
0 1143

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: MJay | last post by:
can someone provide me some codes that can print out a datagrid after i have loaded the datagrid with records in a DataTable?
4
by: Peter Afonin | last post by:
Hello: When I print the report based on the datagrid content, often the last line on the page is cut in half, and the next half appears on the next page. How can I format the page to avoid this?...
1
by: Paresh | last post by:
Hi I need to Print asp:datagrid with formatting, which will avoid my writing of crystal reports and can directly print with click of a button. I do not just want to print the current page, I...
0
by: Michael Chong | last post by:
My Datagrid displays few pages of row data with gridline nicely shown. But when I do print to hardcopy, start from the second page of the printing, gridlines are unable to shown out on the...
0
by: Paco Ferre | last post by:
Hello, I founded some examples of WebControl printing in internet and tryed to have them working for a DataGrid, something not very complicated. I have a page, Page1.aspx with a DataGrid...
5
by: ComputerStop | last post by:
I am attempting to print a datagridview. I have not found any method that works successfully. Has any one been successful with this?
0
by: Ripendra007 | last post by:
hi, Can u tell me how can i print the data of datgrid to next page with header column on next paper ? I hav dataset which contains information of groupwise report and bound to datagrid now i want ro...
0
by: gujarsachin2001 | last post by:
Hello friends, I am working on one of web application which needs to print datagrid values on one of the button click event.So can anybody please help me out. thanks, Sachin.
1
by: pappu | last post by:
Hello friends, I am working on one of web application which needs to print datagrid values on one of the button click event.So can anybody please help me out. thanks, Sachin.
1
by: berry | last post by:
Hi al.. How to print all data in the datagrid?? Including the row header? Hope to help. Thank you very much..
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.