Hi everyone....
Is there way by code to email a report. I create temporary table which the reports uses in access database.
Could some1 give me an example or something to get me started...i dont want to save the report...i just want my vb.net (2003) application by a command button... to got to rptDischargeSummary and email it?
i've got this far...but dont know how to email the report... which is in access database
many thanks
Is there way by code to email a report. I create temporary table which the reports uses in access database.
Could some1 give me an example or something to get me started...i dont want to save the report...i just want my vb.net (2003) application by a command button... to got to rptDischargeSummary and email it?
i've got this far...but dont know how to email the report... which is in access database
Code:
Function EmailFile()
'Step 4: Emails summary to coding department
Dim olapp As New Outlook.Application
Dim ol As Outlook._MailItem
Dim body As String
body = Chr(13) & Chr(13) & "Dear Coding Department" & Chr(13) & Chr(13)
body = body & "Please find attached the ICU Discharge Summary data for :" & Chr(13) & Chr(13)
body = body & "Patient Name : " & txtName.Text & "" & Chr(13)
body = body & "Hospital Number : " & mrn & "" & Chr(13)
body = body & "ICU Reference : " & pid & "" & Chr(13) & Chr(13)
body = body & "Any problems, please contact ICU on Ext 82268" & Chr(13) & Chr(13)
body = body & "Karen Franklin" & Chr(13)
body = body & "Intensive Care Department" & Chr(13)
body = body & "First Floor, East Wing 1" & Chr(13)
body = body & "Ext 82268"
'test.Session.Logon()
ol = olapp.CreateItem(Outlook.OlItemType.olMailItem)
ol.To = CodingEmailAddress
ol.Subject = "ICU Discharge Summary (Hosp Number = " & mrn & ")"
ol.Body = body
ol.OriginatorDeliveryReportRequested = False
ol.Save()
ol.Send()
ol = Nothing
'test.Session.Logoff()
olapp = Nothing
End Function
many thanks