Sunday

IE7 opening excel files.

may not be working , check out : http://blogs.msdn.com/excel/archive/2006/09/26/771221.aspx



Public Shared Sub ExportToExcel(ByVal objViewcreator As ViewCreatorGeneral, ByVal dtFromDatabase As DataTable, ByVal inColumnArrList As ArrayList, ByVal report_header As String, ByVal originalSort As String)

System.Web.HttpContext.Current.Response.ClearContent()
System.Web.HttpContext.Current.Response.ClearHeaders()
System.Web.HttpContext.Current.Response.Charset = ""
System.Web.HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "inline; filename=report.xls")
System.Web.HttpContext.Current.Response.AddHeader("Pragma", " private")
System.Web.HttpContext.Current.Response.AddHeader("Cache-control", " private, must-revalidate")

'writing tab separated stuff here
Dim tabFile As String = "my tab separted cols crlf separeted rows"
System.Web.HttpContext.Current.Response.BinaryWrite(Encoding.GetBytes(tabFile))

System.Web.HttpContext.Current.Response.End()
End Sub


more...

No comments:

test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...