Introduction

E-ICEBLUE is developing office.net component, the main products include Spire.Doc, Spire.PDF, Spire.XLS, Spire.presentation, office Spire and so on. It means that they are the word, PDF, Excel, PowerPoint, office development kit .With the help of those products, developers can essily handle office documents or develop their own applications on the .NET platform.

Product evaluation invitation

I am glad to receive this invitation today (2016/04/12). To be honest, it is the first time for me to do a testing on product even though my major is sofeware. Perhaps it is because of this, that I am determined to spare no effort in doing this test.

  E-iceblue官网:http://www.e-iceblue.com/(冰蓝科技)。

Download & Installation

Download Link :http://www.e-iceblue.com/downloads/pack/spire.office_2.13.zip

Inatallation:

ICON:

Here I want to show you how to use the Spire.XLS to export data and import data.

Programming Guid

(1)Create a Project & Add Reference

(2)Using Namespace

In this project, I use the namespace as follows:

using System;
using System.Data.OleDb;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data; using Spire.Xls;

(3)Initialization Component

private void InitializeComponent()
{
this.btnRun = new System.Windows.Forms.Button();
this.btnAbout = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// btnRun
//
this.btnRun.Location = new System.Drawing.Point(, );
this.btnRun.Name = "btnRun";
this.btnRun.Size = new System.Drawing.Size(, );
this.btnRun.TabIndex = ;
this.btnRun.Text = "Run";
this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
//
// btnAbout
//
this.btnAbout.Location = new System.Drawing.Point(, );
this.btnAbout.Name = "btnAbout";
this.btnAbout.Size = new System.Drawing.Size(, );
this.btnAbout.TabIndex = ;
this.btnAbout.Text = "Close";
this.btnAbout.Click += new System.EventHandler(this.btnAbout_Click);
//
// label1
//
this.label1.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)()));
this.label1.Location = new System.Drawing.Point(, );
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(, );
this.label1.TabIndex = ;
this.label1.Text = "I am a Label , following is DataGrid,I will show you how to export data by Spire." +
"XLS";
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(, );
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ReadOnly = true;
this.dataGrid1.Size = new System.Drawing.Size(, );
this.dataGrid1.TabIndex = ;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(, );
this.ClientSize = new System.Drawing.Size(, );
this.Controls.Add(this.dataGrid1);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnAbout);
this.Controls.Add(this.btnRun);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Spire.XLS sample";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false); }

(4)Clean up any resources being used (we can use it in other projects)

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

(5)Button Click

private void btnRun_Click(object sender, System.EventArgs e)
{
Workbook workbook = new Workbook(); workbook.LoadFromFile(@"e:\\我的课表.xls");
//Initailize worksheet
Worksheet sheet = workbook.Worksheets[]; this.dataGrid1.DataSource = sheet.ExportDataTable();
} private void btnAbout_Click(object sender, System.EventArgs e)
{
Close();
}

(6)Result 

It's easy to use ,isn't it?

.NET读写Excel工具Spire.XlS使用(DataExport )的更多相关文章

  1. 【原创】.NET读写Excel工具Spire.Xls使用(1)入门介绍

    在.NET平台,操作Excel文件是一个非常常用的需求,目前比较常规的方法有以下几种: 1.Office Com组件的方式:这个方式非常累人,微软的东西总是这么的复杂,使用起来可能非常不便,需要安装E ...

  2. 【原创】.NET读写Excel工具Spire.Xls使用(2)Excel文件的控制

                  本博客所有文章分类的总目录:http://www.cnblogs.com/asxinyu/p/4288836.html .NET读写Excel工具Spire.Xls使用文章 ...

  3. 【原创】.NET读写Excel工具Spire.Xls使用(3)单元格控制

                  本博客所有文章分类的总目录:http://www.cnblogs.com/asxinyu/p/4288836.html .NET读写Excel工具Spire.Xls使用文章 ...

  4. 【原创】.NET读写Excel工具Spire.Xls使用(4)对数据操作与控制

                  本博客所有文章分类的总目录:http://www.cnblogs.com/asxinyu/p/4288836.html .NET读写Excel工具Spire.Xls使用文章 ...

  5. 【原创】.NET读写Excel工具Spire.Xls使用(5)重量级的Excel图表功能

                  本博客所有文章分类的总目录:http://www.cnblogs.com/asxinyu/p/4288836.html .NET读写Excel工具Spire.Xls使用文章 ...

  6. .NET读写Excel工具Spire.Xls使用(1)入门介绍

    原文:[原创].NET读写Excel工具Spire.Xls使用(1)入门介绍 在.NET平台,操作Excel文件是一个非常常用的需求,目前比较常规的方法有以下几种: 1.Office Com组件的方式 ...

  7. 【目录】C#操作Excel组件Spire.XLS系列文章目录

    本博客所有文章分类的总目录链接:http://www.cnblogs.com/asxinyu/p/4288836.html 1.C#操作Excel组件Spire.XLS文章目录 1.[原创].NET读 ...

  8. NPOI写Excel,Spire.XLS for.NET组件转换Excel为PDF

    首先要引用NPOI动态库和Microsoft.Office.Interop.excel.dll (Microsoft.Office.Interop.excel.dll  最好使用使用NuGet下载 , ...

  9. POI读取excel工具类(xls,xlsx通用)

    package com.boot.utils; import java.io.File; import java.io.FileInputStream; import java.io.FileNotF ...

随机推荐

  1. 【转载】那些年我们一起清除过的浮动demo

    返回文章:那些年我们一起清除过的浮动 闭合浮动 与 清除浮动 的区别 .main:很抱歉,现代浏览器中我没能把warp撑高(float:left) .side:我也浮动了(float:left) .f ...

  2. MYSQL 函数 字符串到整数

    SELECT CAST('002' AS signed) 结果为2 SELECT CAST('125e342.83' as signed) 结果为 125

  3. “Win10 UAP 开发系列”之主题模式切换

    微软动作真是快,本来想写WP8.1RT系列,结果刚整理了一点就出Win10 UAP了.不过还好RT到Win10的差别还不算太大.前两天参加了Win10开发极客秀,虽然没获奖,不过在韦恩卑鄙的帮助下顺利 ...

  4. SQLite中文排序

    定义一个类: using System.Data.SQLite; namespace DAL { /// <summary> /// SQLite中文排序 /// </summary ...

  5. 关于easyUI的模态对话框

    本文版权归博客园和作者吴双本人共同所有,转载和爬虫请注明原文地址.博客园蜗牛cnblogs.com/tdws 会用easyUI的模态对话框会是我们的开发更加简洁,只需下载这个插件,把需要的文件拖到项目 ...

  6. MVC开发经验总结

    网站开发中技术问题的笔记 以下经验基于 MVC 5.2.3 Javascript BUG思考 200 OK真的表示没有问题吗? 有时候Status 200作为WebAPI的返回值,并不表示真的OK,例 ...

  7. Hello, Android 快速入门

    Hello, Android Android 开发与 Xamarin 简介 在这两节指南中,我们将 (使用 Xamarin Studio或 Visual Studio)建立我们的第一个 Xamarin ...

  8. InfluxDB学习之InfluxDB的安装和简介

    最近用到了 InfluxDB,在此记录下学习过程,同时也希望能够帮助到其他学习的同学. 本文主要介绍InfluxDB的功能特点以及influxDB的安装过程.更多InfluxDB详细教程请看:Infl ...

  9. texrecon进行纹理映射

    使用texrecon进行纹理映射: 1)       跳转到mesh所在目录 cd meshdir 2)       参数 a)         texrecon.exe b)         bun ...

  10. MVC初认

    初探MVC 何谓MVC 简单来说就是开发程序时所使用的一种“架构(框架)”.它就是开发的一种观念,或者说是存在已久的设计规则.我们知道在开发过程中总会伴随着需求.技术.客户.老板等因素的变化,给开发带 ...