Hi,
I am using the infragistic utrawebgrid.I want to print it .if i use the simple window.print function then it is printing good.
But my requirement is to show the grid in a new window and then print.For this i am using the javascript function as below
function CallPrintGrid(divGrid) { var prtContent = document.getElementById(divGrid); var WinPrint = window.open('','','letf=0,top=0,width=800px,height=400px,toolbar=0,scrollbars=0,status=0'); WinPrint.document.write(prtContent.innerHTML); WinPrint.document.close(); WinPrint.focus(); WinPrint.print(); WinPrint.close(); }
The problem is i am not able to get the grid border lines while printing.I have set the displaylayout.readonly property to PrintingFriendly.
Plz help its argent
Thanks & Regards
Gitanjali
I figured out that the the following property solves this problem for me:
grid.DisplayLayout.BorderCollapseDefault = BorderCollapse.Separate;
If you also like to have grayed columns or rows, set the IE option under Advanced print background and images to be enabled.
Hope it helps
Markus
Hi Markus,
I have set the property but there is no difference at all.The look is ok at the main page but it is not showing the border in the printing window.
I have also set the IE property .
Hello,
I'm not very experienced with html and java script.... but I also open a new window by client side java script:
//Add code to handle your event here.
features += (screen.availWidth-130);
features += (screen.availHeight-130);
features += ",location=no,status=no,toolbar=no"
}
THis opens my print options page in a new browser window. From there users can click an Image button that redirects to the print page. The print page contains my grid. The grid properties are set as mentioned before (Printing friendly, Borders separate).
// Basic grid settings
// -------------------
grid.Width = Unit.Percentage( 100.0 );
grid.DisplayLayout.ReadOnly = ReadOnly.PrintingFriendly;
grid.DisplayLayout.AllowDeleteDefault = Infragistics.WebUI.UltraWebGrid.AllowDelete.No;
grid.DisplayLayout.RowSelectorsDefault = Infragistics.WebUI.UltraWebGrid.RowSelectors.No;
// Border Settings
// ---------------
// Seperate borders for printing
In the browser print preview, there were only borders on the first page. After setting the borders to separate the preview and print results shows the borders fine.
Sorry, thats all I can provide you.
Hi thanks a lot for ur reply but i have solved it by using the following property
WorkTimesGridView.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.DownLevel;
Regards,
GP
Gitanjali wrote: Hi thanks a lot for ur reply but i have solved it by using the following property WorkTimesGridView.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.DownLevel; Regards, GP
I follow your suggest but some times the grid throw a javascript error on the onmousemove event...
it looks like your line of code enable some javascript events that should be disable ....
Hello Abhi,
You can always search our forums for solutions, I just run a search on "printing" and found two very helpful articles
1) Print Preview option in UltraWebGrid
http://forums.infragistics.com/forums/p/9775/40811.aspx#40811
2) Print
http://forums.infragistics.com/forums/p/5705/25227.aspx#25227
3) Print Stylesheets and Ultrawebgrid
http://forums.infragistics.com/forums/p/3249/17797.aspx#17797
There are plenty of suggestions and ideas there. I personally would recommend export to print friendly media first (PDF) and then printing (suggestion with code in the second link), but any other approach is fine as well.
Hi Gitanjali,
Some how i am able to pirnt some data in the grid to the page .. but the problem is i have some 20 col and for me only 5 columns are printing to the page and getting scroll bars also pritned ..
Please let me know how i can print all columns ...
Abhi
Hi Gitanjali, Could you please share the code that you had implemented.I need to implement the same funcatinality.
Thanks,Abhi