Help with Loading Crystal reportPpath

dae2604e

New member
Joined
Mar 20, 2011
Messages
1
Programming Experience
Beginner
How do I load Crystal Report When I deploy it as .exe file

Heres my code:

Dim strReportPath As String = Application.StartupPath

myDataAdapter.Fill(myDataset, "Payroll")

Dim rep As New ReportDocument

rep.Load("C:/../Payroll.rpt")
rep.SetDataSource(myDataset)


Me.CrystalReportViewer1.ReportSource = rep
CrystalReportViewer1.Refresh()

My problem is how do i load it by not putting (C:/../,,Payroll.rpt) on rep.Load,,, I tried Application.StartupPath + "\Payroll.rpt" but doesnt work....

Plss... help.... Newbie :|
 
Hi,

Have you tried putting your \ the other way such as application.startup + "/reportname.rpt" also if you have put the report in a folder then you need to put the folder name in such as application.startup + "/report/reportname.rpt"

Hope it helps

Aidan
 
Back
Top