Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
2.50/5 (4 votes)
I installed crystal report in visual studio.
I need to add a report in to my windows application.

What I have tried:

I created a form and i added one crystal report viewer. In the page load event

ReportDocument cryRpt = new ReportDocument();
         crystalReportViewer1.ReportSource = cryRpt;
         cryRpt.Load(@"~/cr/oo.rpt");
         crystalReportViewer1.Refresh();


Any one please help on how can I add a crystal report in c# windows project.
Posted
Updated 6-Feb-17 23:47pm
Comments
[no name] 5-Feb-17 7:03am    
Learn the difference between Winforms and web application to begin with. "~" doesn't work for Winforms. You have to give an actual path.
Afzaal Ahmad Zeeshan 5-Feb-17 7:22am    
You are just a beginner, keep learning and you will understand the how-tos of this. There are various things to tinker before you can get these frameworks to work.

1 solution

 
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