The following is my Employee Table, of which the data I will show as a report in ASP.NET using Crystal Reports.
Image 1.
Now open Visual Studio then select File -> New -> Web Site.
Image 2.
Then right-click on the Solution Explorer then select Add New Item then select Crystal Reports then click Add.
Image 3.
Image 4.
Here expand something then select Create New Connection then select OLE DB (ADO) then a pop-up window will open. Select Microsoft OLE DB Provider for SQL Server then click Next.
Image 5.
Now enter your SQL Server details.
Image 6.
Image 7.
Now select your database then select your table and Move.
Image 8.
Now select the columns to be shown in the reports. Then click Finish.
Image 9.
Now you can see your report is ready. All the columns are already in the Details sections. You can remove any column or you can add a new column by drag and drop from the fields explorer to the report.
Image 10.
Now to add a Report Viewer for showing this Crystal Reports report. In the Default.aspx page drag and drop a CrystalReportViewer from the toolbox like the following.
Image 11.
Now for the Page_Load event write the following code:
- using System;
- using System.Configuration;
- using System.Data;
- using System.Linq;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Xml.Linq;
- using CrystalDecisions.CrystalReports.Engine;
-
- public partial class _Default : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- ReportDocument cryRpt = new ReportDocument();
- cryRpt.Load(Server.MapPath("EmployeeCrystalReport.rpt"));
- CrystalReportViewer1.ReportSource = cryRpt;
- }
- }
Now run your application:
Image 12.
salman AhmedPosted Jul 26, 2021, 3:45 AM EDT
How to set credential login?
Ritwik SahasrabuddhePosted Sep 15, 2018, 8:42 AM EDT
It shows blank output in VS2015 using these Steps
Pankaj KhairnarPosted Sep 7, 2018, 11:45 PM EDT
It shows blank output
Jyothi AugustinePosted Apr 25, 2018, 7:53 PM EDT
Unable to create crystal report using above instruction for vs 2015
amjad s rPosted Dec 22, 2017, 1:10 AM EST
Thanks..... Nice article.......
Sandeep SinghPosted Sep 13, 2016, 4:02 AM EDT
How to set header height and width of crystal report
Sandeep KumarPosted Jun 26, 2016, 2:09 AM EDT
unable to create crystal report using above instruction for vs 2012
Pradeep SahooPosted May 27, 2016, 3:56 PM EDT
Nice article...Thanks for sharing
Uzair AnsariPosted Apr 4, 2016, 11:42 PM EDT
i am working on visual studio 2015 is there any version issue
Uzair AnsariPosted Apr 4, 2016, 11:41 PM EDT
unable to create crystal report on using above instruction,
Rahul Kumar SaxenaTOP 100Posted Apr 1, 2016, 1:18 AM EDT
Thanks 2 All
Rahul Kumar SaxenaTOP 100Posted Apr 1, 2016, 1:18 AM EDT
I will write soon on your requirement Veera Muthu & hothorasman panjaitan
Rahul Kumar SaxenaTOP 100Posted Apr 1, 2016, 1:17 AM EDT
Thanks Sonu Chaudhary
Sonu ChaudharyPosted Mar 31, 2016, 8:04 AM EDT
good one article
hothorasman panjaitanPosted Nov 28, 2015, 8:01 AM EST
how to display image from path, in crystal report asp.net
veera muthuPosted Nov 5, 2015, 10:43 AM EST
how to create crystal report without using sqlconnection ? then i need static image inside the crystal report...Help me Sir??????
Rahul Kumar SaxenaTOP 100Posted Sep 22, 2015, 12:03 AM EDT
Thanks Aappasaheb Tawale
Rahul Kumar SaxenaTOP 100Posted Sep 22, 2015, 12:02 AM EDT
Are you talking any object ...chaitanya kumar
chaitanya kumarPosted Sep 21, 2015, 11:06 PM EDT
I am getting bobj is undefined.How to resolve this issue
Aappasaheb TawalePosted Sep 18, 2015, 2:46 AM EDT
Really helpful me. Thank you
mustafa essoufiPosted Jul 21, 2015, 5:28 AM EDT
hi, I followed the steps and whene i execute no data display (i'm working with vs 2012)
Rahul Kumar SaxenaTOP 100Posted May 4, 2015, 11:27 PM EDT
Thanks Santhakumar Munuswamy...
Santhakumar MunuswamyPosted May 4, 2015, 10:38 AM EDT
Good work
Rahul Kumar SaxenaTOP 100Posted Feb 28, 2015, 7:46 PM EST
Thanks 2 All..
Rahul Kumar SaxenaTOP 100Posted Feb 28, 2015, 7:46 PM EST
Thanks Rakesh..
RakeshPosted Feb 28, 2015, 6:33 PM EST
it's nice demo.
RakeshPosted Feb 28, 2015, 6:33 PM EST
Thank you.
Saineshwar BageriPosted Dec 15, 2014, 6:17 PM EST
nice start
Praveen KumarPosted Dec 15, 2014, 5:54 PM EST
good...