SlideShare uma empresa Scribd logo
1 de 10
1




Excel 元件 -EPPlus!
Presented by
Joncash
6/1/2012
2




Outline
•   Introduction EPPlus
•   Other Library
•   Limit & License
•   How to use
•   Snippet Code
•   References
3




Introduction EPPLus
• EPPlus is a .net library that reads and writes
  Excel 2007/2010 files using the Open Office Xml
  format (xlsx).
• EPPlus 提供簡單、便捷的 API 介面
 ▫ 用 .Cells[rowIndex, colIndex] 就能直接存取欄位
 ▫ 用 .Cells[r1:c1] 就能取得一段選取範圍
 ▫ 用 Cells[…].Style.Font.Color.SetColor(Color.Red)
   改變字型
 ▫ Many more
4




Other Library
• NPOI Library
 ▫ 源自於 Apache POI 專案
• Open XML SDK
 ▫ 微軟提供的函式庫
• OpenOffice.org SDK
 ▫ OpenOffice
• LinqToExcel
 ▫ 只限於讀取
5




Limit & License
• Only Support Excel 2007/2010
• LGPL ( GNU Lesser General Public
  License )
 ▫ 純引用 Library 不用 open source.
 ▫ 有修改 Library, 修改的部份要及產品中使用到的
   Source Code 要 Open Source
6




How to use
• Download
 ▫ http://epplus.codeplex.com/
 ▫ NuGet
• Reference EPPlus.dll in your project
7




Snippet Code
//Create Excel
FileInfo newFile = new FileInfo(outputDir.FullName +
  @"sample6.xlsx");
ExcelPackage pck = new ExcelPackage(newFile);

//Add the Content sheet
var ws = pck.Workbook.Worksheets.Add("Content");

//set style
ws.Cells["B1:E1"].Style.Font.Bold = true;

//set value
ws.Cells["B1"].Value = "Name";
8




EPPlus and Linq
var sheet1 = pck.Workbook.Worksheets["Sheet1"];
var query = (from cell in sheet1.Cells["a:a"]
where cell.Value != ""
select cell);
query3.SingleOrDefault().Value.Dump();




                     Version 2.8 has added support for
                     enumeration of cells....
9




NPOI V.S EPPlus
NPOI                                        EPPLUs
// 建立 worksheet                             var pck = new ExcelPackage(new
var workBook = new HSSFWorkbook();          FileInfo(@"D:EPPLus.xlsx"));

// 建立 sheet                                 // 建立 sheet
var sheet1 =                                var sheet1 =
workBook.CreateSheet("Sheet1");
                                            pck.Workbook.Worksheets.Add("Sheet1")
                                            ;
// 設值
sheet1.CreateRow(1).CreateCell(1).SetCell
Value("XXX");                               // 設值
                                            sheet1.Cells[1, 1].Value = "XXX";
// 存檔
FileStream file = new                       // 存檔
FileStream(@"C:NPOI.xls",                  pck.Save();
FileMode.Create);
hssfworkbook.Write(file);
file.Close();
10




References
• 比NPOI更討喜的Excel元件-EPPlus!
• EPPlus-Create advanced Excel 2007 spreadsheets on
• [C#] NPOI、OpenXML SDK、
  OpenOffice.org SDK 寫入資料到 EXCEL 檔案
• 在 Server 端存取 Excel 檔案的利器:
  NPOI Library
• Creating Reports in Excel 2007 using EPPlus (

Mais conteúdo relacionado

Mais procurados

Ingesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptIngesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptLucidworks
 
Apache avro and overview hadoop tools
Apache avro and overview hadoop toolsApache avro and overview hadoop tools
Apache avro and overview hadoop toolsalireza alikhani
 
Elasticsearch 101 - Cluster setup and tuning
Elasticsearch 101 - Cluster setup and tuningElasticsearch 101 - Cluster setup and tuning
Elasticsearch 101 - Cluster setup and tuningPetar Djekic
 
Hands On Spring Data
Hands On Spring DataHands On Spring Data
Hands On Spring DataEric Bottard
 
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...Lucidworks
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchSperasoft
 
ElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
ElasticES-Hadoop: Bridging the world of Hadoop and ElasticsearchElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
ElasticES-Hadoop: Bridging the world of Hadoop and ElasticsearchMapR Technologies
 
From Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityFrom Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityStéphane Gamard
 

Mais procurados (12)

Ingesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScriptIngesting and Manipulating Data with JavaScript
Ingesting and Manipulating Data with JavaScript
 
SQLite
SQLiteSQLite
SQLite
 
Apache avro and overview hadoop tools
Apache avro and overview hadoop toolsApache avro and overview hadoop tools
Apache avro and overview hadoop tools
 
Elasticsearch 101 - Cluster setup and tuning
Elasticsearch 101 - Cluster setup and tuningElasticsearch 101 - Cluster setup and tuning
Elasticsearch 101 - Cluster setup and tuning
 
Catmandu Librecat
Catmandu LibrecatCatmandu Librecat
Catmandu Librecat
 
Hands On Spring Data
Hands On Spring DataHands On Spring Data
Hands On Spring Data
 
laravel-53
laravel-53laravel-53
laravel-53
 
Building a Search Engine Using Lucene
Building a Search Engine Using LuceneBuilding a Search Engine Using Lucene
Building a Search Engine Using Lucene
 
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
Faster Data Analytics with Apache Spark using Apache Solr - Kiran Chitturi, L...
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
ElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
ElasticES-Hadoop: Bridging the world of Hadoop and ElasticsearchElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
ElasticES-Hadoop: Bridging the world of Hadoop and Elasticsearch
 
From Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalabilityFrom Lucene to Elasticsearch, a short explanation of horizontal scalability
From Lucene to Elasticsearch, a short explanation of horizontal scalability
 

Destaque

Ukraine export restrictions 652
Ukraine export restrictions 652Ukraine export restrictions 652
Ukraine export restrictions 652app_don
 
Borrador trabajo final_de_disenos
Borrador trabajo final_de_disenosBorrador trabajo final_de_disenos
Borrador trabajo final_de_disenossoradriana
 
Ukraine export restrictions 658
Ukraine export restrictions 658Ukraine export restrictions 658
Ukraine export restrictions 658app_don
 
Ukraine export restrictions 653
Ukraine export restrictions 653Ukraine export restrictions 653
Ukraine export restrictions 653app_don
 
Desarrollo del i examen parcial de instalaciones en edificaciones i
Desarrollo del i examen parcial de instalaciones en edificaciones iDesarrollo del i examen parcial de instalaciones en edificaciones i
Desarrollo del i examen parcial de instalaciones en edificaciones idennith
 
Ukraine export restrictions 655
Ukraine export restrictions 655Ukraine export restrictions 655
Ukraine export restrictions 655app_don
 
Neuville mai 2012
Neuville mai 2012Neuville mai 2012
Neuville mai 2012neuville95
 
Histologia tecido conjuntivo especial, muscular e nervoso
Histologia tecido conjuntivo especial, muscular e nervosoHistologia tecido conjuntivo especial, muscular e nervoso
Histologia tecido conjuntivo especial, muscular e nervosorobervalmoraes
 
Aula de Embriologia (UNESP - CLP)
Aula de Embriologia (UNESP - CLP)Aula de Embriologia (UNESP - CLP)
Aula de Embriologia (UNESP - CLP)Gilmar Giraldelli
 

Destaque (14)

Ukraine export restrictions 652
Ukraine export restrictions 652Ukraine export restrictions 652
Ukraine export restrictions 652
 
Resolución 007 2015
Resolución 007 2015Resolución 007 2015
Resolución 007 2015
 
Borrador trabajo final_de_disenos
Borrador trabajo final_de_disenosBorrador trabajo final_de_disenos
Borrador trabajo final_de_disenos
 
Ukraine export restrictions 658
Ukraine export restrictions 658Ukraine export restrictions 658
Ukraine export restrictions 658
 
React.js 20150828
React.js 20150828React.js 20150828
React.js 20150828
 
objeto
objetoobjeto
objeto
 
Cabalgata 2 O1 O
Cabalgata 2 O1 OCabalgata 2 O1 O
Cabalgata 2 O1 O
 
Chistes
ChistesChistes
Chistes
 
Ukraine export restrictions 653
Ukraine export restrictions 653Ukraine export restrictions 653
Ukraine export restrictions 653
 
Desarrollo del i examen parcial de instalaciones en edificaciones i
Desarrollo del i examen parcial de instalaciones en edificaciones iDesarrollo del i examen parcial de instalaciones en edificaciones i
Desarrollo del i examen parcial de instalaciones en edificaciones i
 
Ukraine export restrictions 655
Ukraine export restrictions 655Ukraine export restrictions 655
Ukraine export restrictions 655
 
Neuville mai 2012
Neuville mai 2012Neuville mai 2012
Neuville mai 2012
 
Histologia tecido conjuntivo especial, muscular e nervoso
Histologia tecido conjuntivo especial, muscular e nervosoHistologia tecido conjuntivo especial, muscular e nervoso
Histologia tecido conjuntivo especial, muscular e nervoso
 
Aula de Embriologia (UNESP - CLP)
Aula de Embriologia (UNESP - CLP)Aula de Embriologia (UNESP - CLP)
Aula de Embriologia (UNESP - CLP)
 

Semelhante a 20120601_Excel 元件 ep plus joncash

Exploiting JXL using Selenium
Exploiting JXL using SeleniumExploiting JXL using Selenium
Exploiting JXL using SeleniumOSSCube
 
How to Read Excel Files in Java (1).pdf
How to Read Excel Files in Java (1).pdfHow to Read Excel Files in Java (1).pdf
How to Read Excel Files in Java (1).pdfSudhanshiBakre1
 
Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Alexandro Colorado
 
Alex Troush - IEx Cheat Sheet
Alex Troush - IEx Cheat Sheet Alex Troush - IEx Cheat Sheet
Alex Troush - IEx Cheat Sheet Elixir Club
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaopenseesdays
 
PYTHON FOR SPREADSHEET USERS.pptx
PYTHON FOR SPREADSHEET USERS.pptxPYTHON FOR SPREADSHEET USERS.pptx
PYTHON FOR SPREADSHEET USERS.pptxrmlkmrPphtt
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCLEdward Willink
 
Let's Compare: A Benchmark review of InfluxDB and Elasticsearch
Let's Compare: A Benchmark review of InfluxDB and ElasticsearchLet's Compare: A Benchmark review of InfluxDB and Elasticsearch
Let's Compare: A Benchmark review of InfluxDB and ElasticsearchInfluxData
 
06 file processing
06 file processing06 file processing
06 file processingIssay Meii
 
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...InSync2011
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSVTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSvtunotesbysree
 
Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015Adrien Grand
 
Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic WebLuigi De Russis
 

Semelhante a 20120601_Excel 元件 ep plus joncash (20)

Apache poi tutorial
Apache poi tutorialApache poi tutorial
Apache poi tutorial
 
Apachepoitutorial
ApachepoitutorialApachepoitutorial
Apachepoitutorial
 
Python openpyxl
Python openpyxlPython openpyxl
Python openpyxl
 
Exploiting JXL using Selenium
Exploiting JXL using SeleniumExploiting JXL using Selenium
Exploiting JXL using Selenium
 
How to Read Excel Files in Java (1).pdf
How to Read Excel Files in Java (1).pdfHow to Read Excel Files in Java (1).pdf
How to Read Excel Files in Java (1).pdf
 
Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.Office OpenXML: a technical approach for OOo.
Office OpenXML: a technical approach for OOo.
 
Alex Troush - IEx Cheat Sheet
Alex Troush - IEx Cheat Sheet Alex Troush - IEx Cheat Sheet
Alex Troush - IEx Cheat Sheet
 
PHPExcel and OPENXML4J
PHPExcel and OPENXML4JPHPExcel and OPENXML4J
PHPExcel and OPENXML4J
 
mdeshell
mdeshellmdeshell
mdeshell
 
Introduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKennaIntroduction to OpenSees by Frank McKenna
Introduction to OpenSees by Frank McKenna
 
Introduction to UNIX
Introduction to UNIXIntroduction to UNIX
Introduction to UNIX
 
PYTHON FOR SPREADSHEET USERS.pptx
PYTHON FOR SPREADSHEET USERS.pptxPYTHON FOR SPREADSHEET USERS.pptx
PYTHON FOR SPREADSHEET USERS.pptx
 
Enrich Your Models With OCL
Enrich Your Models With OCLEnrich Your Models With OCL
Enrich Your Models With OCL
 
Let's Compare: A Benchmark review of InfluxDB and Elasticsearch
Let's Compare: A Benchmark review of InfluxDB and ElasticsearchLet's Compare: A Benchmark review of InfluxDB and Elasticsearch
Let's Compare: A Benchmark review of InfluxDB and Elasticsearch
 
06 file processing
06 file processing06 file processing
06 file processing
 
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
 
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERSVTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
VTU 3RD SEM UNIX AND SHELL PROGRAMMING SOLVED PAPERS
 
Excel Scripting
Excel Scripting Excel Scripting
Excel Scripting
 
Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015Apache Lucene intro - Breizhcamp 2015
Apache Lucene intro - Breizhcamp 2015
 
Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic Web
 

Mais de LearningTech

Mais de LearningTech (20)

vim
vimvim
vim
 
PostCss
PostCssPostCss
PostCss
 
ReactJs
ReactJsReactJs
ReactJs
 
Docker
DockerDocker
Docker
 
Semantic ui
Semantic uiSemantic ui
Semantic ui
 
node.js errors
node.js errorsnode.js errors
node.js errors
 
Process control nodejs
Process control nodejsProcess control nodejs
Process control nodejs
 
Expression tree
Expression treeExpression tree
Expression tree
 
SQL 效能調校
SQL 效能調校SQL 效能調校
SQL 效能調校
 
flexbox report
flexbox reportflexbox report
flexbox report
 
Vic weekly learning_20160504
Vic weekly learning_20160504Vic weekly learning_20160504
Vic weekly learning_20160504
 
Reflection & activator
Reflection & activatorReflection & activator
Reflection & activator
 
Peggy markdown
Peggy markdownPeggy markdown
Peggy markdown
 
Node child process
Node child processNode child process
Node child process
 
20160415ken.lee
20160415ken.lee20160415ken.lee
20160415ken.lee
 
Peggy elasticsearch應用
Peggy elasticsearch應用Peggy elasticsearch應用
Peggy elasticsearch應用
 
Expression tree
Expression treeExpression tree
Expression tree
 
Vic weekly learning_20160325
Vic weekly learning_20160325Vic weekly learning_20160325
Vic weekly learning_20160325
 
D3js learning tips
D3js learning tipsD3js learning tips
D3js learning tips
 
git command
git commandgit command
git command
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

20120601_Excel 元件 ep plus joncash

  • 1. 1 Excel 元件 -EPPlus! Presented by Joncash 6/1/2012
  • 2. 2 Outline • Introduction EPPlus • Other Library • Limit & License • How to use • Snippet Code • References
  • 3. 3 Introduction EPPLus • EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx). • EPPlus 提供簡單、便捷的 API 介面 ▫ 用 .Cells[rowIndex, colIndex] 就能直接存取欄位 ▫ 用 .Cells[r1:c1] 就能取得一段選取範圍 ▫ 用 Cells[…].Style.Font.Color.SetColor(Color.Red) 改變字型 ▫ Many more
  • 4. 4 Other Library • NPOI Library ▫ 源自於 Apache POI 專案 • Open XML SDK ▫ 微軟提供的函式庫 • OpenOffice.org SDK ▫ OpenOffice • LinqToExcel ▫ 只限於讀取
  • 5. 5 Limit & License • Only Support Excel 2007/2010 • LGPL ( GNU Lesser General Public License ) ▫ 純引用 Library 不用 open source. ▫ 有修改 Library, 修改的部份要及產品中使用到的 Source Code 要 Open Source
  • 6. 6 How to use • Download ▫ http://epplus.codeplex.com/ ▫ NuGet • Reference EPPlus.dll in your project
  • 7. 7 Snippet Code //Create Excel FileInfo newFile = new FileInfo(outputDir.FullName + @"sample6.xlsx"); ExcelPackage pck = new ExcelPackage(newFile); //Add the Content sheet var ws = pck.Workbook.Worksheets.Add("Content"); //set style ws.Cells["B1:E1"].Style.Font.Bold = true; //set value ws.Cells["B1"].Value = "Name";
  • 8. 8 EPPlus and Linq var sheet1 = pck.Workbook.Worksheets["Sheet1"]; var query = (from cell in sheet1.Cells["a:a"] where cell.Value != "" select cell); query3.SingleOrDefault().Value.Dump(); Version 2.8 has added support for enumeration of cells....
  • 9. 9 NPOI V.S EPPlus NPOI EPPLUs // 建立 worksheet var pck = new ExcelPackage(new var workBook = new HSSFWorkbook(); FileInfo(@"D:EPPLus.xlsx")); // 建立 sheet // 建立 sheet var sheet1 = var sheet1 = workBook.CreateSheet("Sheet1"); pck.Workbook.Worksheets.Add("Sheet1") ; // 設值 sheet1.CreateRow(1).CreateCell(1).SetCell Value("XXX"); // 設值 sheet1.Cells[1, 1].Value = "XXX"; // 存檔 FileStream file = new // 存檔 FileStream(@"C:NPOI.xls", pck.Save(); FileMode.Create); hssfworkbook.Write(file); file.Close();
  • 10. 10 References • 比NPOI更討喜的Excel元件-EPPlus! • EPPlus-Create advanced Excel 2007 spreadsheets on • [C#] NPOI、OpenXML SDK、 OpenOffice.org SDK 寫入資料到 EXCEL 檔案 • 在 Server 端存取 Excel 檔案的利器: NPOI Library • Creating Reports in Excel 2007 using EPPlus (