且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

关于从表格打印的C#问题

更新时间:2023-01-27 11:08:03

有很多方法,如果你有 Word 那么你可以使用Word自动化,请看这里的文章:使用C#进行Word自动化:以编程方式创建Word表格 [ ^ ]

您也可以使用报表查看器控件,但遗憾的是,在较新的Visual Studio版本中不再安装此标准,仍然可以通过下载此控件然而,NuGet

ReportViewer 2016控件入门| Microsoft Docs [ ^ ]



当然,也可以在代码中以编程方式执行所有操作,请参阅: PrintDocument Class(System.Drawing.Printing) [ ^ ]
There are lots of ways, if you have Word then you can use Word automation, see article here: Word Automation using C#: Create a Word Table Programatically[^]
You can also use the Report Viewer control, but sadly this is not installed standard anymore in newer Visual Studio version, it's still possible to download this control via NuGet however.
Getting started with the ReportViewer 2016 control | Microsoft Docs[^]

Of course it's also possible to do everything programmatically in code, see: PrintDocument Class (System.Drawing.Printing)[^]