Before I got this blog, I submitted this post to Dotnetspark.com and Programmers.com. Now, I share it in my new blog and hope that this post can be helpful for people who need to export data to Excel.
This article introduces a Wizard which is used to export data from database and shows the guide to use it. This Wizard can used both by programmers and general users.
In this example, I export the data about customers' information of 2008 from database to Excel and then generate chart based on the parts of data without Automation quickly. Before using the following method to export data, we need to install .Net Framework 2.0 and free Spire.DataExport firstly.
The following tables are the parts of customers' data.
1. Select a database.
2. Select data source from database. In the example, I choose Table.
3. Select essential columns to export.
4. Select the Chart type. There are three types: Column Chart, Bar Chart or Line Chart, can be chosen.
Step in Details
Step 1: select Database.
Choose the database which saves the customers' information. Then input the connection string to connect to the database.
Step 2: Get the data source.
Select Data Source firstly. I choose Table. Then, select the table named customers.
Step 3: Select the columns I need to export. In this example, I just only need two columns, Name and Shopping Quantity.
Step 4: Select the Chart Type. In order to display the data clearly, I choose BarChart.
After clicking Finish, we can get the Excel Worksheet as following:
This method can be used to export data from database into Excel and generate charts efficiently. In this method, we use one small tool, named DataExportWizard to export data simply, which originates from the free data export component. You can click here to download the free component.
If you want to download this Wizard, you can visit this link: http://www.dotnetspark.com/kb/3716-fast-export-data-from-database-to-excel.aspx