表生成器
你可以使用以下程序与docx工作:WindowsWord, Libre Office, Open Office, Word Pad, AiReader, Ice Book Reader, Caliber, Universal Viewer, Text Maker, Ability Write。这只是众多可以打开DOCX格式文件的程序中的一小部分。
之前我们讲解了【从Delphi / Lazarus将 表导出到Excel XML】。但是如何从Delphi或Lazarus创建DOCX格式的文件呢下来为你讲解。
在Delphi中保存docx格式,无需编写任何代码!
首先,在表单上添加TfrxReport和TfrxDOCXExport(导出到Microsoft Word 2007 XML)组件。然后在设计器中创建一个 告模板,生成一个 告,点击预览窗口中的保存,并从预览中调用导出(下面我将描述如何使用Delphi代码以DOCX格式保存)。导出到DOCX设置的窗口将会出现。
虽然设置不多,但还是值得一谈的。首先,我们可以选择将文档的哪些页面导出为Word——特定的页面或某个范围。

通常,可以指定DOCX文件的保存位置(在本地存储中、通过电子邮件发送、上传到FTP或云)。
导出后打开:结果文件将在导出后立即被与这些文件关联的任何软件打开。

如何保存在DOCX格式直接从Delphi / Lazarus使用代码
procedure TForm1.Button1Click(Sender: TObject);begin {Generate a report. The report must be generated before exporting} frxReport1.PrepareReport(); {Set the range of pages to export. By default, all pages of the generated report are exported} frxDOCXExport1.PageNumbers := '2-3'; {Set whether to open the resulting file after export} frxDOCXExport1.OpenAfterExport := False; {Set whether to display export progress (show which page is currently being exported)} frxDOCXExport1.ShowProgress := False; {Set whether to display the export filter settings dialog box} frxDOCXExport1.ShowDialog := False; {Set the name of the resulting file.} {Please note that if you do not set the file name and disable the export filter dialog box,} {the file name selection dialog will still be displayed} frxDOCXExport1.FileName := 'C:Outputtest.docx'; {Export the report} frxReport1.Export(frxDOCXExport1);end;
Fastreport在线购买价更低!赶紧加入购物清单吧!
还想要更多吗可以点击阅读【FastReport 表2020最新资源盘点】,查找需要的教程资源。如果您有任何疑问或需求,请随时加入FastReport技术交流群(),我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!