資源簡(jiǎn)介
1, 有Vs2008 ,VS2010實(shí)例代碼
2,不需要安裝office,不用com來(lái)調(diào)用了,免去了很多麻煩,調(diào)用office有時(shí)存在版本兼容問(wèn)題,還要重新安裝office很麻煩
3. 能夠讀取,生成,excel, word,功能真的很強(qiáng)大
代碼片段和文件信息
/*?====================================================================
???Licensed?to?the?Apache?Software?Foundation?(ASF)?under?one?or?more
???contributor?license?agreements.??See?the?NOTICE?file?distributed?with
???this?work?for?additional?information?regarding?copyright?ownership.
???The?ASF?licenses?this?file?to?You?under?the?Apache?License?Version?2.0
???(the?“License“);?you?may?not?use?this?file?except?in?compliance?with
???the?License.??You?may?obtain?a?copy?of?the?License?at
???????http://www.apache.org/licenses/LICENSE-2.0
???Unless?required?by?applicable?law?or?agreed?to?in?writing?software
???distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
???WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
???See?the?License?for?the?specific?language?governing?permissions?and
???limitations?under?the?License.
====================================================================?*/
using?System;
using?System.Text;
using?System.IO;
using?NPOI.HSSF.UserModel;
using?NPOI.HPSF;
using?NPOI.POIFS.FileSystem;
using?NPOI.HSSF.Util;
using?NPOI.SS.UserModel;
/*?This?sample?is?copied?from?poi/hssf/usermodel/examples/Hyperlink.java?*/
namespace?AddHyperlinkInXls
{
????class?Program
????{
????????static?void?Main(string[]?args)
????????{
????????????InitializeWorkbook();
????????????////cell?style?for?hyperlinks
????????????////by?default?hyperlinks?are?blue?and?underlined
???????????ICellstyle?hlink_style?=?hssfworkbook.CreateCellstyle();
????????????IFont?hlink_font?=?hssfworkbook.CreateFont();
????????????hlink_font.Underline?=?(byte)FontUnderlineType.SINGLE;
????????????hlink_font.Color?=?HSSFColor.BLUE.index;
????????????hlink_style.SetFont(hlink_font);
????????????ICell?cell;
????????????ISheet?sheet?=?hssfworkbook.CreateSheet(“Hyperlinks“);
????????????//URL
????????????cell?=?sheet.CreateRow(0).CreateCell(0);
????????????cell.SetCellValue(“URL?link“);
????????????HSSFHyperlink?link?=?new?HSSFHyperlink(HyperlinkType.URL);
????????????link.Address?=?(“http://poi.apache.org/“);
????????????cell.Hyperlink?=?(link);
????????????cell.Cellstyle?=?(hlink_style);
????????????//link?to?a?file?in?the?current?directory
????????????cell?=?sheet.CreateRow(1).CreateCell(0);
????????????cell.SetCellValue(“File?link“);
????????????link?=?new?HSSFHyperlink(HyperlinkType.FILE);
????????????link.Address?=?(“l(fā)ink1.xls“);
????????????cell.Hyperlink?=?(link);
????????????cell.Cellstyle?=?(hlink_style);
????????????//e-mail?link
????????????cell?=?sheet.CreateRow(2).CreateCell(0);
????????????cell.SetCellValue(“Email?link“);
????????????link?=?new?HSSFHyperlink(HyperlinkType.EMAIL);
????????????//note?if?subject?contains?white?spaces?make?sure?they?are?url-encoded
????????????link.Address?=?(“mailto:poi@apache.org?subject=Hyperlinks“);
????????????cell.Hyperlink?=?(link);
????????????cell.Cellstyle?=?(hlink_style);
????????????//link?to?a?place?in?this
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????200704??2013-03-06?07:13??npoi\dotnet2\ICSharpCode.SharpZipLib.dll
?????文件????1624064??2013-03-06?07:17??npoi\dotnet2\NPOI.dll
?????文件?????387072??2013-03-06?07:17??npoi\dotnet2\NPOI.OOxm
?????文件??????79872??2013-03-06?07:17??npoi\dotnet2\NPOI.Openxm
?????文件????????120??2013-03-06?07:13??npoi\dotnet2\NPOI.Openxm
?????文件????1316864??2013-03-06?07:17??npoi\dotnet2\NPOI.Openxm
?????文件????2144246??2013-03-06?07:17??npoi\dotnet2\NPOI.xm
?????文件?????200704??2013-03-06?07:13??npoi\dotnet3.5\ICSharpCode.SharpZipLib.dll
?????文件????1624064??2013-03-06?07:17??npoi\dotnet3.5\NPOI.dll
?????文件?????387072??2013-03-06?07:17??npoi\dotnet3.5\NPOI.OOxm
?????文件??????79872??2013-03-06?07:17??npoi\dotnet3.5\NPOI.Openxm
?????文件????????120??2013-03-06?07:13??npoi\dotnet3.5\NPOI.Openxm
?????文件????1316864??2013-03-06?07:17??npoi\dotnet3.5\NPOI.Openxm
?????文件????2144246??2013-03-06?07:17??npoi\dotnet3.5\NPOI.xm
?????文件?????200704??2013-03-06?07:13??npoi\dotnet4\ICSharpCode.SharpZipLib.dll
?????文件????1624064??2013-03-06?07:17??npoi\dotnet4\NPOI.dll
?????文件?????387072??2013-03-06?07:17??npoi\dotnet4\NPOI.OOxm
?????文件??????79872??2013-03-06?07:17??npoi\dotnet4\NPOI.Openxm
?????文件????1316864??2013-03-06?07:17??npoi\dotnet4\NPOI.Openxm
?????文件????2145032??2013-03-06?07:13??npoi\dotnet4\NPOI.xm
?????文件???????4432??2013-03-05?08:10??npoi\examples\hssf\AddHyperli
?????文件????????257??2013-03-05?08:10??npoi\examples\hssf\AddHyperli
?????文件???????4498??2013-03-05?08:10??npoi\examples\hssf\AddHyperli
?????文件???????1446??2013-03-05?08:10??npoi\examples\hssf\AddHyperli
?????文件???????4398??2013-03-05?08:10??npoi\examples\hssf\ApplyFontInXls\ApplyFontInXls.csproj
?????文件????????257??2013-03-05?08:10??npoi\examples\hssf\ApplyFontInXls\ApplyFontInXls.csproj.vspscc
?????文件???????4594??2013-03-05?08:10??npoi\examples\hssf\ApplyFontInXls\Program.cs
?????文件???????1440??2013-03-05?08:10??npoi\examples\hssf\ApplyFontInXls\Properties\AssemblyInfo.cs
?????文件???????4441??2013-03-05?08:10??npoi\examples\hssf\AutoSizeColumnInXls\AutoSizeColumnInXls.csproj
?????文件????????257??2013-03-05?08:10??npoi\examples\hssf\AutoSizeColumnInXls\AutoSizeColumnInXls.csproj.vspscc
............此處省略475個(gè)文件信息
- 上一篇:C#打開(kāi)電腦攝像頭
- 下一篇:PDFView PDF文件處理59003
評(píng)論
共有 條評(píng)論