Hi,
I'm trying to export a xamdatagrid to excel.
I included like in the feature browser the namespaces and got no error in xaml.
Then added to cs:
using Infragistics.Windows.DataPresenter.ExcelExporter; using Infragistics.Documents.Excel;
private void btnExport_Click(object sender, RoutedEventArgs e) { ExportOptions expopts = new ExportOptions(); string fileName = ""; FolderBrowserDialog folderDialog = new FolderBrowserDialog(); folderDialog.SelectedPath = "C:\\"; DialogResult result = folderDialog.ShowDialog(); if (result != System.Windows.Forms.DialogResult.OK) return; fileName = folderDialog.SelectedPath; fileName += "Export.xslx"; DataPresenterExcelExporter exporter = (DataPresenterExcelExporter)this.Resources["Exporter"]; exporter.Export(dgData, fileName, WorkbookFormat.Excel2007, expopts); }
try to run and get this error:
Error 8 Argument 3: cannot convert from 'Infragistics.Documents.Excel.WorkbookFormat [d:\Program Files (x86)\Infragistics\NetAdvantage 2011.2\Windows Forms\CLR4.0\Bin\Infragistics4.Documents.Excel.v11.2.dll]' to 'Infragistics.Documents.Excel.WorkbookFormat' ...DlgList.xaml.cs 133 47
References added to project:
Infragistics4.Documents.Excel.v11.2
Infragistics4.DataPresenter
Infragistics4.DataPrsesenter.ExcelExporter
I can't see any error ? Can anybody help ?
Delete this, found error, Includedf
Infragistics4.Documents.... not InfragisticsWPF4.Documents ......