Hi,in XamGrid I want to export the data to excel;in your control XamDataGrid I can use the DataPresenterExcelExporter-Class.Is there a way to use the DataPresenterExcelExporter-Class in XamGrid?Thanks voks
Hi voks,
Because of the underlying differences between the XamGrid and XamDataGrid, the DataPresenterExcelExporter can only be used with the XamDataGrid.
I think this link will be very helpful. It explains how you can export the XamGrid to Excel.http://help.infragistics.com/Help/NetAdvantage/Silverlight/2011.2/CLR4.0/html/SL_Exporting_xamGrid_Data_to_Excel.html
A few things to note. The link points to the Silverlight documentation but the code used to export the grid is the same for WPF as well. Make sure you include the WPF versions of the assemblies mentioned on the page as well as add InfragisticsWPF4.DataManager.v11.2.dll to the list.
Let me know if you have any questions on this.
Do you require further assistance on this?
Hi Rob,Thanks for your help!I have implemented an excel-export with the InfragisticsWPF4.DataMananger.v11.2.dll,as described in the help and it works!One more question I have:In my Xamgrid I have two grouped headers. How can I implement the groups in your Excel-Class?I would like to display the grouping rows in excel like they are converted and displayed in the xamdatagrid-excel-export...
Thanks
voks
When you say grouped headers do you mean this:http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamGrid_Group_Column.html
or this:http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamGrid_GroupBy.html
If you are talking about the first one, you can achieve the same look in excel by following this help topic:http://help.infragistics.com/Help/NetAdvantage/jQuery/2011.2/CLR4.0/html/ExcelEngine_Merge_Cells.html
If you are talking about the second one, this forum post might be useful to check out. It explains how Rows become GroupByRows from which you can check the data.http://community.infragistics.com/forums/p/54204/280463.aspx#280463
Hi Rob,In my xamgrid I use groupby like this
http://help.infragistics.com/NetAdvantage/WPF/2011.2/CLR4.0/?page=xamGrid_GroupBy.htmlhere is a short code-snippet:...<ig:XamGrid.Columns > <ig:TextColumn IsSorted="Ascending" IsGroupBy="True" HeaderText="Personenkontodescription" Key="Personenkontodescription">...I can export the data of the groupby-record and the nested records belonging to the Groupby-record.
My Question is:
How can I display the groupby-record in the created excel-worksheet in a grouped way.You can see a sample of grouped-excel-output (and this is, what I want to implement),if you export grouped data from xamdatagrid to excel.
I have similar problem.. but I have different senario.
I have 3 XamaDataGrid on form and I want to Export all grids it to one excel on different sheets.
How can I do that.
Hi Cloud,
I've attached a working sample that exports a grid of 20 columns and 20 rows. Can you run this sample on your machine and let me know if the issue still exists.
Also can you provide the stack trace for the exception you currently have in your project? Please provide the InnerException details as well.
not very much... about 20 columns and 20 rows i guess... that´s always different...
i´m using 12.1
How many rows and columns are you trying to export? I'll create a sample to test this. Also which version of NetAdvantage are you using? 11.2? 12.1? 12.2?
xporter.Export(grid,filename,WorkbookFormat.Excel2007, options);
in this line i get my error...
but it´s not always a NullReferenceException sometimes it is AccessViolenceException...
there i set my DatePresenterExcelReporter.
<Window.Resources> <igExcelExporter:DataPresenterExcelExporter x:Key="excelExporter"></igExcelExporter:DataPresenterExcelExporter> </Window.Resources>.
But it stillt doesn´t work if i use a new instance of the DataPresenterExcelExporter....
On which line is the NullReferenceException occuring? The debugger should tell you where the exception occurs.
The only reason I can see from the code you provided that would cause an exception is the line where you set the DataPresenterExcelExporter equal to the exporter you pull from the Resources collection. That line will return null if it can't find the item you're looking for.