Export data to Excel from Silverlight/WPF DataGrid
Posted
by outcoldman
on ASP.net Weblogs
See other posts from ASP.net Weblogs
or by outcoldman
Published on Wed, 21 Apr 2010 18:47:00 GMT
Indexed on
2010/04/21
18:53 UTC
Read the original article
Hit count: 1724
c#
|wpf
|dynamic
|xaml
|excel
|datagrid
|com
|Silverlight 4
|Silverlight
|WPF 4
Data export from DataGrid to Excel is very common task, and it can be solved with different ways, and chosen way depend on kind of app which you are design. If you are developing app for enterprise, and it will be installed on several computes, then you can to advance a claim (system requirements) with which your app will be work for client. Or customer will advance system requirements on which your app should work. In this case you can use COM for export (use infrastructure of Excel or OpenOffice). This approach will give you much more flexibility and give you possibility to use all features of Excel app. About this approach I’ll speak below. Other way – your app is for personal use, it can be installed on any home computer, in this case it is not good to ask user to install MS Office or OpenOffice just for using your app. In this way you can use foreign tools for export, or export to xml/html format which MS Office can read (this approach used by JIRA). But in this case will be more difficult to satisfy user tasks, like create document with landscape rotation and with defined fields for printing.
At this article I'll show you how to work with Excel object from .NET 4 and Silverlight 4 with dynamic objects and give you an approach which allow you to export data from DataGrid Silverlight and WPF controls.
© ASP.net Weblogs or respective owner