无需Excel即可从Delphi导出到Excel

发布于 2024-08-25 22:29:44 字数 71 浏览 5 评论 0 原文

我希望将数据从 Delphi 导出到 Excel,而无需拥有 Excel 副本,这可能吗?

注意 CSV 不行。

I'm looking to export data to excel from Delphi without having to own a copy of excel, is this possible?

N.B. CSV will not do.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

违心° 2024-09-01 22:29:44

FlexCel 以前是一个开源项目,现在由 TMS 管理 (http://www.tmssoftware.com/site/flexcel .asp)效果很好。

您还可以在 http://www.torry.net 上查看 TmxNativeExcel。免费且使用原生 Biff 格式。不过我还没有尝试过。

FlexCel, earlier an Opensource now managed by TMS (http://www.tmssoftware.com/site/flexcel.asp) works great.

You can also check TmxNativeExcel at http://www.torry.net. Comes free and is uses native Biff format. I've not tried this though.

留一抹残留的笑 2024-09-01 22:29:44

尝试 zexmlss。该库可以创建和加载 Excel 2003 XML 格式文件。支持合并单元格、边框、垂直和水平对齐等。 Zlib 许可证。使用 delphi 6、7、9-14 和 lazarus。

Try zexmlss. This library can create and load excel 2003 XML format files. Support merged cells, borders, vertical and horizontal alignment and other. Zlib license. Work with delphi 6, 7, 9-14 and lazarus.

终难遇 2024-09-01 22:29:44

我相信可以将 MS Office 文档创建为 HTML。您无需在 Web 浏览器中打开它们,文件仍然可以具有扩展名 .xls 并像平常一样在 Excel 中打开。

我刚刚创建了一个新的电子表格,并将数字 1-3 粘贴到 A 列的前三个单元格中,并将其另存为 HTML。有一堆额外的混乱可能并不完全必要。我尽可能地删除了内容,这看起来是生成工作电子表格的最低限度的内容。

尝试创建一个新的文本文件并将其作为其内容,并使用 .xls 扩展名保存。

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetOptions>
     <x:Selected/>
     <x:Panes>
      <x:Pane>
       <x:Number>3</x:Number>
       <x:ActiveRow>3</x:ActiveRow>
      </x:Pane>
     </x:Panes>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
 </x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body>

<table x:str>
    <tr>
        <td x:num width=64>1</td>
    </tr>
    <tr>
        <td x:num>2</td>
    </tr>
    <tr>
        <td x:num>3</td>
    </tr>
</table>
</body>
</html>

I believe it's possible to create MS Office documents as HTML. You don't need to open them in a web browser then or anything, the file can still have the extension .xls and open in Excel like normal.

I just created a new spreadsheet and stuck the numbers 1-3 in the first three cells of column A, and saved it as HTML. There was a bunch of extra mess that probably isn't all necessary. I stripped out as much as I could, here's what looks to be the bare minimum to produce a working spreadsheet.

Try creating a new text file with this as its contents, and save it with a .xls extension.

<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:Name>Sheet1</x:Name>
    <x:WorksheetOptions>
     <x:Selected/>
     <x:Panes>
      <x:Pane>
       <x:Number>3</x:Number>
       <x:ActiveRow>3</x:ActiveRow>
      </x:Pane>
     </x:Panes>
     <x:ProtectContents>False</x:ProtectContents>
     <x:ProtectObjects>False</x:ProtectObjects>
     <x:ProtectScenarios>False</x:ProtectScenarios>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
 </x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body>

<table x:str>
    <tr>
        <td x:num width=64>1</td>
    </tr>
    <tr>
        <td x:num>2</td>
    </tr>
    <tr>
        <td x:num>3</td>
    </tr>
</table>
</body>
</html>
°如果伤别离去 2024-09-01 22:29:44

oExport - XLSX/ODS 原生 Delphi 导入/导出库

  • 不需要外部 dll 库 不
  • 依赖于 Excel 或 Calc 安装(无 OLE)
  • 完全 unicode 支持,甚至对于 D7、D2007
  • 支持的单元格类型:字符串、数字、百分比、公式、时间、日期、日期时间
  • 单元格格式:单元格宽度+高度、水平+垂直对齐、换行文本、字体、背景颜色、边框
  • 列/行跨度
  • 经过测试并在 Delphi 2007 和 XE2 32 位+64 位下工作:应与所有 D7 到 XE2
  • 兼容OFiller:填充 DOCX (Word 2007)、ODT (OpenOffice Writer)、XLSX (Excel 2007)、ODS (OpenOffice Calc) 模板

http://www.kluug.at/xlsx-ods-delphi.php

根据 MPL/GPL/LGPL 三重许可证获得许可
版本:MPL 1.1/GPL 2.0/LGPL 2.1

oExport - XLSX/ODS native Delphi import/export library

  • no external dll libraries are required
  • no dependency on Excel or Calc installation (no OLE)
  • full unicode support even for D7, D2007
  • supported cell types: string, number, percent, formula, time, date, datetime
  • cell formatting: cell width+height, horizontal+vertical alignment, wrap text, font, background color, borders
  • col/row span
  • tested and working under Delphi 2007 and XE2 32bit+64bit: should be compatible with all D7 to XE2
  • NEW OFiller: fill DOCX (Word 2007), ODT (OpenOffice Writer), XLSX (Excel 2007), ODS (OpenOffice Calc) templates

http://www.kluug.at/xlsx-ods-delphi.php

licensed under a MPL/GPL/LGPL tri-license
Version: MPL 1.1/GPL 2.0/LGPL 2.1

一个人的夜不怕黑 2024-09-01 22:29:44

Scalabium (scalabium.com) 的 SMExport 包含多种格式,包括安装或未安装 Excel 的 Excel 格式。

SMExport from Scalabium (scalabium.com) includes lots of formats, including Excel format with or without having Excel installed.

放赐 2024-09-01 22:29:44

前面提到的NativeExcel来自Nika-Soft。不是免费的,但效果很好。我现在使用它已经一年多了,没有任何问题。 http://www.nika-soft.com/nativeexcel2/

NativeExcel mentioned earlier is from Nika-Soft. Not free, but it works fine. I am using it now for over one year without problems. http://www.nika-soft.com/nativeexcel2/

输什么也不输骨气 2024-09-01 22:29:44

TXLSFile 库 v.4.0。和 XLSExport 组件

我们已成功用于 D2007、D2009 和 XLSExport 组件。 D2010

什么是 TXLSFile

  TXLSFile is a Delphi library for reading and writing MS Excel 
  XLS files. It is based on direct reading and writing of files, 
  and works without OLE Automation with Microsoft Excel. 

  TXLSFile is  distributed  with  XLSExport  components  package. 
  XLSExport is a Delphi components package  for quick data 
  export  into  MS Excel file with  one line  of code.  

http://sm-software.com

TXLSFile library v.4.0. and XLSExport components

We've used successfully with D2007, D2009 & D2010

What is TXLSFile

  TXLSFile is a Delphi library for reading and writing MS Excel 
  XLS files. It is based on direct reading and writing of files, 
  and works without OLE Automation with Microsoft Excel. 

  TXLSFile is  distributed  with  XLSExport  components  package. 
  XLSExport is a Delphi components package  for quick data 
  export  into  MS Excel file with  one line  of code.  

http://sm-software.com

够运 2024-09-01 22:29:44

有一种非常简单的方法可以实现这一点,那就是使用文本文件。简单地输出数据,每个字段后面跟着一个逗号,后面跟着一个回车符。使用 .CSV 扩展名保存此文件。这在 Excel 上应该仍然有效;我这几天用Open Officew

theree is a very simple way to achive this and is by use of a text file. Simply output the data, each field followed by a comma, followed by a carriage return. Save this file with a .CSV extension. This should still work on Excel; I use Open Officw these days

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文