Click here to Skip to main content
15,843,200 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am creating windows application with crystal reports. To access the crystal report we have to give full path of the crystal report like below.

crystalReportViewer1.ReportSource = cryreport;

If we want to give this project to client we also have to give reports to client with exe file.

So i have created Set up and deployment project for this application and i have put all reports in the Application folder of Set up and deployment project.

So my question is that after putting reports in the application folder what path i have to give in

Please any one can help me in this. I need it in urgent.

Thanks and in regards in advance.
Updated 14-Sep-11 20:35pm
Prerak Patel 15-Sep-11 1:35am    
Added code block.

These values you can use as to get the root location where the setup in actually being installed and then further sub directories can be added with any of them to locate the folder (same as used in setup project) which contains the .rpt files.

For application:


For Windows App using VB.Net:

Share this answer
Look at below link for details
Share this answer
RaviRanjanKr 17-Sep-11 3:50am    
hey! Rakesh I've just convert Url to Hyperlink. I think you missed it :)
Thanks for all your help.

Finally I got the solution

Application.StartupPath + "\\" + "MyReport.rpt";

Application.StartupPath & "\" & "MyReport.rpt";

Revert back to me if you still find problem.
Share this answer
You can do this way:

Put all your .rpt files in the debug folder of your application.

And write this in your code:

string paths = Path.GetDirectoryName(Application.ExecutablePath) + ".\\Village.rpt";

And In setup and deployment put all your .rpt files along with .exe in application folder.

hope it helps :)

for further queries comment here!
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900