Private Sub Btn_Print_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImgBtn_Print.Click
Dim stringWrite As New System.IO.StringWriter
Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)
Dim w As System.Web.UI.WebControls.Unit
w.Pixel(400)
DataGrid1.Width = w
Dim scr As String = "<script>function window.onafterprint(){history.back(1);}</script>"
htmlWrite.Write(scr)
Dim str As String = "" '"<div align=center id=titl1><h3><Font face=Verdana>Your DataGrid:</font></h3></div>"
htmlWrite.Write(str)
DataGrid1.RenderControl(htmlWrite)
Dim strHTML As String = stringWrite.ToString()
Response.Clear()
' you could send it to Excel, too....
'Response.ContentType = "application/vnd.ms-excel"
Response.ContentType = "text/HTML"
Response.Write(strHTML)
Response.Write("<script>window.print();</script>")
Response.End()
End Subتم تعديل هذه المشاركة بواسطة ashrafweb في 3 أكتوبر 2005 في 11:11
::::التوقيع::::
موقع ممتاز
وان شاء الله يفيد الجميع
وشكرا
؟؟لماذا لا يصل الايميل المرسل من صفحتي الي الهوتميل؟؟
مستوي الجدية في المواضيع المطروحة
لا اله الا الله محمد رسول الله