PatelNehal4u
Active member
- Joined
- Apr 6, 2009
- Messages
- 25
- Programming Experience
- 1-3
Hello Everyone,
I had created an application named "WindowsApplication1" and created forms in it "Form1" & "Form2", now from just call the form2 and form2 contain a crystalreportviewer1 tool. Now my application also contain a crystalreport which i want to load in crystalreportviewer1 from form1. so i write code like this in form1
now Application.StartupPath returning the path which is :
C:\Users\Guest\VisualStudio2008\Projects\WindowsApplication\bin\Debug
and my report is stored in
C:\Users\Guest\VisualStudio2008\Projects\WindowsApplication\
is there any help that i can get my application path, not the execution path.
i also tried something like :
but not satisfied....
I had created an application named "WindowsApplication1" and created forms in it "Form1" & "Form2", now from just call the form2 and form2 contain a crystalreportviewer1 tool. Now my application also contain a crystalreport which i want to load in crystalreportviewer1 from form1. so i write code like this in form1
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim crprpt As New ReportDocument
Dim frm As New Form2
crprpt.Load(Application.StartupPath & "\CrystalReport1.rpt")
frm.CrystalReportViewer1.ReportSource = crprpt
frm.CrystalReportViewer1.Refresh()
frm.Show()
End Sub
now Application.StartupPath returning the path which is :
C:\Users\Guest\VisualStudio2008\Projects\WindowsApplication\bin\Debug
and my report is stored in
C:\Users\Guest\VisualStudio2008\Projects\WindowsApplication\
is there any help that i can get my application path, not the execution path.
i also tried something like :
VB.NET:
My.Application.Info.DirectoryPath()
AppDomain.CurrentDomain.BaseDirectory.ToString()
Environment.CurrentDirectory.ToString()