---
title: "CrystalReportViewer Control in ASP.Net"  
description: "Where A Crystal Reports is the standard reporting tool for Visual Studio .NET. It's used to display data of presentation quality. Steps to generate"  
author: "John Smith"  
published: 2010-12-03  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/206/crystalreportviewer-control-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# CrystalReportViewer Control in ASP.Net

Where A [Crystal Reports](https://www.mindstick.com/forum/306/how-used-the-sum-function-in-crystal-reports) is the [standard](https://www.mindstick.com/articles/23223/naming-convention-or-coding-standard) [reporting](https://www.mindstick.com/articles/12967/portable-reporting-systems-and-mobile-device-management) tool for [Visual Studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) .NET. It's used to [display data](https://www.mindstick.com/forum/34030/how-to-display-data-in-the-table-using-angular-js) of presentation quality.

## Steps to generate a report using CrystalReportViewer

[Drag and drop](https://www.mindstick.com/forum/454/how-to-drag-and-drop-multiple-image-from-one-canvas-to-onther-canvas-in-html5) CrystalReportViewer

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/1b2cb6fd-08f4-44eb-904e-cac19d471bc8.png)

Add DataSet

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/e2011853-9294-4a8e-a245-07e9af8d8b37.png)

Click add

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/bb4ccf30-3bbb-43d4-b717-ff0265560453.png)

Click on server [explorer](https://yourviews.mindstick.com/view/81617/now-it-is-time-to-say-goodbye-to-internet-explorer)

Drag and [Drop table](https://answers.mindstick.com/qa/116599/what-is-difference-between-delete-table-data-vs-drop-table)

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/cfc9a67d-115e-4997-9781-2b6a6f058e86.png)

Now add CrystalReport

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/ae80880d-1b68-47a1-8928-57773ae91614.png)

Click add

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/c27e01a8-b43d-4416-bc66-dd1070109cc0.png)

Click Ok

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/8ca7db3b-7609-447a-bc0b-9c3079a31182.png)

Expand create ProjectData

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/2ddbe995-661d-48ea-aa85-a34a0766d759.png)

Expand AD.NET [Datasets](https://www.mindstick.com/articles/13138/tableau-training-the-soul-of-datasets) and select table and then click next

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/ff73d9dc-a124-41b6-a7df-b534bf2a9fd3.png)

Click highlighted array to select field and click next

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/b7cd62d1-e10b-4448-b13d-cfa3cf312f9e.png)

Click next

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/a0f712e0-515d-45e1-afb6-704df28d648a.png)

Click next

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/f38a27a3-79fc-4e0b-ba54-ac3fffbcf023.png)

Click finish

```
protected void Page_Load(object sender, EventArgs e){//To instantiate a ReportBuilder, you must provide the ReportDocument to be built.ReportDocument ReportDocument1 = new ReportDocument();//Loading Crystal Report to Report ObjectreportDocumentObj.Load(Server.MapPath("~/CrystalReport.rpt"));//Creating instance of Data Table created earlier.DataSet1.regformDataTable dt = new DataSet1.regformDataTable();DataSet1TableAdapters.regformTableAdapter da = new DataSet1TableAdapters.regformTableAdapter();//Filling data table da.Fill(dt);//Setting Data Source of Report Document. ReportDocument1.SetDataSource((DataTable)dt);//Assigning object of ReportDocument to Crystal Report as ReportSource CrystalReportViewer1.ReportSource = ReportDocument1;  }// Use namespace CrystalDecisions.CrystalReports.Engine;
```

Now Report is generated.

![CrystalReportViewer Control in ASP.Net](https://www.mindstick.com/mindstickarticle/032e6628-ebea-480b-b784-8126fc533758/images/0004416d-6d2a-428d-8293-87f2e88de11c.png)

\

Read also this Article - [**Using ReportViewer in WinForms C#**](https://www.mindstick.com/Articles/1118/using-reportviewer-in-winforms-c-sharp)

---

Original Source: https://www.mindstick.com/articles/206/crystalreportviewer-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
