BENEBNKMET:SSSS Met Hi!Is it possible to create a file in .doc/.docx/.rtf format 1 page per record.The record will be coming from gridview/datatable.The fields and records should be listed in vertical format like:HSBC DOLLAR ACCOUNT //this is a headerDOLLAR REMITANCE //this is a headerEmployee: Juan Dela CruzAccountNo: 1234567AccountName: Juan DLCruzBankCode: Sample Bank of the RepublicBENEBNKMET: SSSS Met推荐答案 DOCX,当然,但最好不要DOC。您可以使用Microsoft开源产品Open XML Format SDK: Office Open XML - Wikipedia,免费的百科全书 [ ^ ], Microsoft Office XML格式 - 维基百科,免费的百科全书 [ ^ ]; 此产品在github上可用: OfficeDev / Open-XML-SDK·GitHub [ ^ ]。 另请参阅Microsoft有关在服务器设置中使用Office互操作的警告: http://support.microsoft.c om / default.aspx?scid = kb; EN-US; q257757 #kb2 [ ^ ], http://support.microsoft.com/kb/257757/en-us [ ^ ]。 另请参见2007年的Microsoft文章(引用的SDK版本已过时,但你可以很好地了解如何使用它):创建文档使用Open XML Format SDK Version 2.0 CTP(第1部分,共3部分) [ ^ ]。 我真的希望我们不需要讨论过时的DOC格式,这些格式很糟糕,搞砸了并且是专有的,没有正式的开放文档。这也是可能的,但马赫更难做。 但是RTF要简单得多。例如,请参阅以下CodeProject文章: RTF文档构造函数库 [ ^ ], RichText Builder(StringBuilder for RTF) [ ^ ]。 -SA DOCX, sure, but better not DOC. You can use Microsoft open-source product Open XML Format SDK:Office Open XML - Wikipedia, the free encyclopedia[^],Microsoft Office XML formats - Wikipedia, the free encyclopedia[^];this product is available on github:OfficeDev/Open-XML-SDK · GitHub[^].See also Microsoft warnings about using Office interop in server settings:http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^],http://support.microsoft.com/kb/257757/en-us[^].See also this Microsoft article of 2007 (the version of SDK referenced to is obsolete, but you can get a good idea how to use it): Creating Documents by Using the Open XML Format SDK Version 2.0 CTP (Part 1 of 3)[^].I really hope we don't need to discuss obsolete DOC formats, which are bad, messed up and proprietary, without official open documentation. It's also possible, but mach harder to do.But RTF is much simpler. For example, see these CodeProject articles:RTF Document Constructor Library[^],RichText Builder (StringBuilder for RTF)[^].—SA 这篇关于从gridview或asp.net中的数据表记录创建doc文件c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
11-01 13:34