Link to home
Create AccountLog in
Avatar of hariprasadere
hariprasadere

asked on

crystal report path on the target machine

hi i have a project where i am using crystalreports.I have a problem when i deployee my application into the target machine.in the code i have written

cr1.reportsource="c:\ems\Reports\test.rpt".It works fine on my machine but in the target machine i have an errors"Loadreport failed".

how can i view the reports in the target machine.you know there is a app.path in vb6  where you can find the file .
how do i use in vb.net?
Avatar of nayernaguib
nayernaguib
Flag of Egypt image

Use System.Windows.Forms.Application.StartupPath. Don't forget to append a backslash "\" to the end of the path. For example:

  cr1.reportsource=System.Windows.Forms.Application.StartupPath + "\test.rpt"

_______________

  Nayer Naguib
Avatar of hariprasadere
hariprasadere

ASKER

again i have same problem here is my code
cr1.ReportSource = System.Windows.Forms.Application.StartupPath + "\shiphari.rpt"
Hi,
After Salutation

Did you create your report by the Wizard?
yes i did
If so,

Sure,the proplem not where are the report , BUT

where are the database where can i get the table(query/view) which the report depend on it.

if so i can help you with the code instead to solve the problem.
ASKER CERTIFIED SOLUTION
Avatar of M3MM
M3MM

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Thanks ,

i'm glad you accppted my answer, so you had solved your problem

thanks for the points.........