Microsoft系统的大多数用户使用常规的记事本或流行的Microsoft Office软件包来打开TXT, Mac OS的用户使用内置的TextEditor。
表生成器
如今,我们已经习惯了这样一个事实:字体格式、样式元素、根据用户偏好确定的大小可以应用于任何符 。还有更特殊的格式,如XML、PHP、CSV和CHM;TXT格式被放置在它们的结构中作为基础。
Microsoft系统的大多数用户使用常规的记事本或流行的Microsoft Office软件包来打开TXT, Mac OS的用户使用内置的TextEditor。
在Delphi中创建文本,无需一行代码!
首先,编译项目并使用’ export to Text file ‘组件实现FastReport。生成一个 告,启动它,并点击“保存”在预览窗口(下面我将描述如何保存在TXT格式使用Delphi代码)。导出到RTF设置的窗口将会出现。


导出设置——是否导出分页符、创建框架、添加空行(在 表的每行之后)、使用OEM代码页(Windows编码被设置为默认)。
导出后打开——结果文件将在与TXT文档关联的任何软件(Notepad、TextEditor)导出后立即打开。
直接从Delphi / Lazarus以TXT格式保存的代码
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} frxSimpleTextExport1.PageNumbers := '2-3'; {Set whether to export the page breaks} frxSimpleTextExport1.PageBreaks := True; {Set whether to export the frames of the generated report objects using pseudo-graphics characters} frxSimpleTextExport1.Frames := False; {Set whether to export empty lines} frxSimpleTextExport1.EmptyLines := False; {Set whether to export the text in OEM or Windows encoding} frxSimpleTextExport1.OEMCodepage := False; {Set whether to open the resulting file after export} frxSimpleTextExport1.OpenAfterExport := False; {Set whether to display export progress (show which page is currently being exported)} frxSimpleTextExport1.ShowProgress := False; {Set whether to display the export filter settings dialog box} frxSimpleTextExport1.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} frxSimpleTextExport1.FileName := 'C:Outputtest.txt'; {Export the report} frxReport1.Export(frxSimpleTextExport1);end;

Fastreport在线购买价更低!赶紧加入购物清单吧!
还想要更多吗可以点击阅读【FastReport 表2019最新资源盘点】,查找需要的教程资源。如果您有任何疑问或需求,请随时加入FastReport技术交流群(),我们很高兴为您提供查询和咨询。
标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!