Hey All,
Hoping someone can give me a helping hand. I think I am on the right track but not sure. I have a reporting web site, ASP.Net and VB.Net (VS 2003) I export the reports to .pdf, .rpt and .doc files. This all works fine. However, when I try and launch these files I get nothing. I was going to use the old ShellExecute function but I understand that it will eventually be phased out and a new Namespace has replaced it: The System.Diagnostics which exposes processes to launch external applications. If I am misusing this or misunderstanding it's purpose..? I am using this code with no results:
Dim myProcess As System.Diagnostics.Process = New System.Diagnostics.Process
Dim myProcessInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo
Dim strFile As String
Select Case strPrintOption
Case "MS Word (DOC)"
strFile = "Word.doc"
Case "MS Excel (XLS)"
strFile = "Excel.xls"
Case "Portable Document (PDF)"
strFile = "PortableDoc.pdf"
Case "Rich Text (RTF)"
strFile = "RichTextFormat.rtf"
End Select
myProcessInfo.UseShellExecute = True
Dim strTest As String = Request.PhysicalApplicationPath + "Exported\" & strFile
myProcessInfo.FileName = strTest
blnReport = True
myProcess.Start(myProcessInfo)
Hoping someone can give me a helping hand. I think I am on the right track but not sure. I have a reporting web site, ASP.Net and VB.Net (VS 2003) I export the reports to .pdf, .rpt and .doc files. This all works fine. However, when I try and launch these files I get nothing. I was going to use the old ShellExecute function but I understand that it will eventually be phased out and a new Namespace has replaced it: The System.Diagnostics which exposes processes to launch external applications. If I am misusing this or misunderstanding it's purpose..? I am using this code with no results:
Dim myProcess As System.Diagnostics.Process = New System.Diagnostics.Process
Dim myProcessInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo
Dim strFile As String
Select Case strPrintOption
Case "MS Word (DOC)"
strFile = "Word.doc"
Case "MS Excel (XLS)"
strFile = "Excel.xls"
Case "Portable Document (PDF)"
strFile = "PortableDoc.pdf"
Case "Rich Text (RTF)"
strFile = "RichTextFormat.rtf"
End Select
myProcessInfo.UseShellExecute = True
Dim strTest As String = Request.PhysicalApplicationPath + "Exported\" & strFile
myProcessInfo.FileName = strTest
blnReport = True
myProcess.Start(myProcessInfo)