Book Image

Reporting with Visual Studio and Crystal Reports

By : Mahmoud Elkoush
Book Image

Reporting with Visual Studio and Crystal Reports

By: Mahmoud Elkoush

Overview of this book

<p>Reports are documents that present focused, salient content to a specific audience. Crystal Reports is a business intelligence application that will help you design and generate reports from a wide range of data sources. It helps you summarize a good deal of information in a visually appealing manner.</p> <p>"Reporting with Visual Studio and Crystal Reports" is a practical, hands-on guide that will provide you with a number of clear, step-by-step exercises, and help you take advantage of the real power of Crystal Reports. This book will not only help you create effective reports, but also teach you how to create a reporting application.</p> <p>"Reporting with Visual Studio and Crystal Reports" will guide you through the installation of Crystal Reports and Visual Studio. As you progress from one chapter to the next, you will gradually build a reporting application. You will also learn how to select the right data, and enhance your report by grouping and sorting data. This book will also help you create chart reports to improve your report design. With this book, you will learn how to create a complete reporting application and a wide variety of reports.</p>
Table of Contents (14 chapters)
Reporting with Visual Studio and Crystal Reports
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Populate the ComboBoxes with data


In our application, we have many ComboBoxes. How do we populate them with data? In this section we will populate the ComboBoxes with data and talk about the basics of select SQL query. We have four main steps to populate any ComboBox in our application: SQL query, TableAdapter, DataSource, and Load Event. Before we start filling the first ComboBox, we need to add DataSet to our application to save the retrieved data by TableAdapter, in to it.

Add DataSet to the application

  1. Right-click on the Monitor application in the Solution Explorer and navigate to Add | New Item.

  2. From the dialog box select DataSet and we will keep it with the default name DataSet1.

Populate the cbEmpTitle ComboBox

  1. Select data: We need to populate this ComboBox with all employees' titles without any duplication.

    As we can see in the following screenshot, we can use a Select query to select Title from Employees table and the DISTINCT keyword to avoid duplication.

  2. Create TableAdapter: Open DataSet1...