数据从DataGrid导出到WPF中的PDF,Excel和CSV文件 [英] Data Export to PDF,Excel and CSV files in WPF from DataGrid

查看:78
本文介绍了数据从DataGrid导出到WPF中的PDF,Excel和CSV文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将DataGrid信息导出为.csv,excel和PDF文件?我正在使用带有.NET Framework 4.0的Microsoft Visual Studio 2010.



请建议我一次实现这三个功能的任何良好链接。





提前谢谢

解决方案

有许多流行的组件用于导出数据与各种文件格式如pdf,csv,excel等。但我使用aspose组件(word,cells)来做到这一点并对此感到满意。只有一件事是它不是免费的。



Link-1

[ ^ ]



对于pdf,itextsearch组件也很受欢迎。它也是开源。如果你想要代码样本那么

http://social.msdn.microsoft.com/Forums/vstudio/en-US/0a7a360b-26e3-4dda -a175-8fb634ba52b9 / how-to-export-data-from-datagrid-in-wpf-to-pdf-with-c- [ ^ ]





你应该循环wpf网格并可以根据网格数据创建数据表并使用aspose组件并根据需要导出它。


感谢SM Ahasan Habib建议我将Export Datagrid的itextsearch.dll导出为PDF。为了将datatgrid数据导出到Excel,我想出了自己。

How can i export my DataGrid information into an .csv , excel and PDF file? I'm using Microsoft Visual Studio 2010 with .NET Framework 4.0.

Please suggest me any good link to achieve these three functionalities at a time.


Thanks in advance

解决方案

there are many popular components for export data with various file format like pdf, csv, excel etc. But i used aspose components(word, cells) for doing that and happy with that. Just one thing that is it is not free.

Link-1
[^]

For pdf itextsearch component is also very popular. It is also opensource. If you want code sample then
http://social.msdn.microsoft.com/Forums/vstudio/en-US/0a7a360b-26e3-4dda-a175-8fb634ba52b9/how-to-export-data-from-datagrid-in-wpf-to-pdf-with-c-[^]


You should loop wpf grid and may create datatable based on that grid data and use aspose component and export it as you want.


Thanks S.M Ahasan Habib for suggesting me itextsearch.dll for Export Datagrid to PDF.For exporting datatgrid data to Excel,i figured out myself.


这篇关于数据从DataGrid导出到WPF中的PDF,Excel和CSV文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆