Professional Documents
Culture Documents
There have been many enquiries about Crystal Reports on the site and unfortunately there
are not too many technical articles and source code samples available on Crystal Reports on
C# Corner or any where else. As usual, I decided to dedicate some time to Crystal Reports
and fill the Crystal Reports section of C# Corner and VB.NET Heaven sites. As a result, in
next couple of weeks you will see some Crystal Reports articles from me. Hopefully, you will
enjoy these articles. Again, I encourage you to share your knowledge with other developers
to make our lives easier.
Unlike previous versions of Visual Studio, Crystal Reports is an integral part of Visual
Studio .NET and ships as a part of it. By making Crystal Reports a part of Visual Studio .NET
suite, Microsoft has added one more useful tool to the Visual Studio family. In this article, I
will show you how to create a simple report using Crystal Reports and Visual Studio .NET. In
my following article, I shall dig more into Crystal Reports .NET.
To follow this article, first create a Windows application by selecting File->New->Project>Visual C# Projects->Windows Application template from Visual Studio .NET project
templates. I give my project name IntroToCR.
Adding a Report to a Project
Crystal Report is a part of Add New Item templates available in Visual Studio. To add a
report to the project, add a new item by Right Clicking on the project in Solution Explorer
and selecting Add->Add New Item->Crystal Report as you can see in Figure 1. I change the
name of the report to Customers because we will be displaying customers related
information from Northwind database.
Now click the Open button.
Figure 8. Customers.rpt
Now compile and run the project. The output looks like Figure 10. Now you can see the
report with data. With the help of Crystal Report Viewer, you can select from various options
such as zoom in, zoom out, print, move next, move last, move previous, and move first.