Email a report
Hello all,
I am trying to email this report as an attachment in my asp.net code. Can some one help me. I am totally lost.
This is the code so far:
Dim oRep As ReportDocument = Nothing
Dim reportPath As String = Server.MapPath("myreport.rpt")
Dim ExportDirectory As ExportOptions = Nothing
Dim htmlOpts As New HTMLFormatOptions()
oRep = New ReportDocument
ExportDirectory = New ExportOptions
oRep.Load(reportPath)
oRep.SetParameterValue("@xxxx", xxxxx)
oRep.SetDatabaseLogon("xxxxx", "xxxxx")
ExportDirectory = oRep.ExportOptions
ExportDirectory.ExportFormatType = ExportFormatType.PortableDocFormat
oRep.ExportToHttpResponse(ExportDirectory, Response, False, "Myreport")
I am able to see this as a pdf document but I am not able send it as an email attachment.
Please help....
Thank You
Kal30
|