Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have below code in my C# apps which will invoke crystal report

MIDL
string reportpath = @"E:\Project\New folder\ARC_GUILT_Pro\ARC_GUILT_Pro\CrystalReport1.rpt";
           report

           report.Load(reportpath);


Please suggest me the best way to include crystal report file path.
Posted
Updated 19-Apr-11 22:06pm
v2

1 solution

Do you mean dynamic path instead of hard-code path? If yes then store the reports files in application directory & call by the below way.

If it's web application
C#
report.Load(Server.MapPath("Report1.rpt"));

else it's windows application
C#
report.Load(Application.StartupPath + "Report1.rpt");
 
Share this answer
 
Comments
Espen Harlinn 16-Jan-11 8:20am    
5+ Nice and simple
Dalek Dave 16-Jan-11 11:01am    
Good Call

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