AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 Crystal Report in Asp.Net 2.0
Posted by boda.raju on  6/24/2008 9:27:43 AM Category: ADO.NET
Add to my favorites
Email to friend
plz explain how to create crystalreport with coding , i want exmple(plz send to ne)

Post Your Reply Post New Question

 Viewer's Reply
Here is the syntax for bind Crystal Report with Asp.Net code-behind
Answered By Moderator1 on 10/15/2008 9:15:52 AM
Hope you know how to design a crystal report, bind it with the Database Expert option and load the crystal report to view through a CrystalReportViewer.

The code to call a crystal report from asp.net code behind is below. Before that create a DataTable and load it with the data you want to display. Then pass the datatable into the SetDataSource method of the ReportDocument as follows.

ReportDocument myreport = new ReportDocument();
myreport.Load(Server.MapPath("CrystalReport.rpt"));
myreport.SetDataSource(dt);

CrystalReportViewer1.ReportSource = myreport;
CrystalReportViewer1.DataBind();

That's it. Run the page, you can see crystal report.
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Web Application Security — How to Minimize Prevalent Risk of Attacks
Backup and Recovery Best Practices for Microsoft SQL Server 2005
Simply SQL - Free 111 Page Preview!