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?
Programming

Avatar of undefined
Last Comment
M3MM

8/22/2022 - Mon
nayernaguib

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
hariprasadere

ASKER
again i have same problem here is my code
cr1.ReportSource = System.Windows.Forms.Application.StartupPath + "\shiphari.rpt"
M3MM

Hi,
After Salutation

Did you create your report by the Wizard?
Your help has saved me hundreds of hours of internet surfing.
fblack61
hariprasadere

ASKER
yes i did
M3MM

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
M3MM

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
M3MM

Thanks ,

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

thanks for the points.........
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.