---
title: "Hosting Crystal Report in Windows Form"  
description: "Here I am going to explain how to host a crystal report in windows application form (visual studio 2010) after creating a crystal report.  Here, I hav"  
author: "Chris Anderson"  
published: 2011-08-24  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/609/hosting-crystal-report-in-windows-form  
category: "crystal report"  
tags: ["crystal report"]  
reading_time: 1 minute  

---

# Hosting Crystal Report in Windows Form

Here I am going to explain how to host a [crystal report](https://www.mindstick.com/articles/930/crystal-report-in-visual-studio-2010) in windows application form ([visual studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) 2010) after creating a crystal report.\

Here, I have created a crystal report with some fields of the [database](https://www.mindstick.com/articles/71/how-to-create-xml-file-of-database-in-c-sharp) object i.e. product_id, product_name, product_quantity from product table.

![Hosting Crystal Report in Windows Form](https://www.mindstick.com/mindstickarticle/09e06499-6f64-4fc6-bc84-8cc40a72103e/images/f30f7ecd-2536-43b0-86e0-00abd140a923.png)

After creating a report you have to host it in your application. Steps for hosting crystal report in an application.

· Drags the Crystal Report Viewer control from toolbox drop it into windows form.

· Drag the button from toolbox and drop it into windows form.

![Hosting Crystal Report in Windows Form](https://www.mindstick.com/mindstickarticle/09e06499-6f64-4fc6-bc84-8cc40a72103e/images/1aa024ba-f621-47ee-9311-3216d7784bfe.png)

**·** Use [namespaces](https://www.mindstick.com/forum/155583/what-are-namespaces-in-c-sharp) in [your application](https://answers.mindstick.com/qa/95487/how-do-you-troubleshoot-when-your-application-link-is-not-responding) as given below:

```
using CrystalDecisions.Shared;using CrystalDecisions.CrystalReports.Engine;using CrystalDecisions.Windows.Forms;
```

**·**On the [click event](https://www.mindstick.com/forum/424/how-to-call-form_paint-event-on-button-click-event) of button write some code [as mentioned](https://answers.mindstick.com/qa/38307/bring-out-the-significance-of-the-terms-sovereign-democratic-republic-as-mentioned-in-the-preamble) below:

```
private void button1_Click (object sender, EventArgs e)    {         ReportDocument cryRpt = new ReportDocument ();         cryRpt.Load ("D:\\rohit\\crystal reports\\CrystalReport1.rpt"); //crystal report                                                                            path         crystalReportViewer1.ReportSource = cryRpt;         crystalReportViewer1.Refresh ();       }
```

After performing the above tasks you can see the output by [running your](https://answers.mindstick.com/blog/343/running-your-first-ai-model-with-ollama) application.

![Hosting Crystal Report in Windows Form](https://www.mindstick.com/mindstickarticle/09e06499-6f64-4fc6-bc84-8cc40a72103e/images/9fdc7808-d625-48f7-a22f-24c95f0d1b76.png)

Click on the **Show Report** button to see a report.

---

Original Source: https://www.mindstick.com/articles/609/hosting-crystal-report-in-windows-form

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
