Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
Export toExcel
posted

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 ?
Parents
No Data
Reply Children
No Data