CompletIT Community Server

Welcome to CompletIT Community Server Sign in | Join | Help
in Search

ExportFileName doesn't appear to work

Last post 08-29-2008, 8:19 AM by djohnson60618. 2 replies.
Sort Posts: Previous Next
  •  08-25-2008, 12:19 PM 7824

    ExportFileName doesn't appear to work

    I have been tackling this for a while, and it is very frustrating.  No matter what I do, ExportFileName is being ignored during an Excel export.

    Instead it puts the file in the default directory, wherever it was last saved.  I wonder if it is a registry issue.

                string dir = "C:\\";
                string fileName = "test.xls";
                ExcelExportDescription exportDescription = new ExcelExportDescription();
                DGVEExcelExportSettings exportSettings = new DGVEExcelExportSettings();
                exportSettings.OpenFolderAfterGeneration = false;
                exportSettings.ExportFileName = dir + fileName;
                exportSettings.OpenFileAfterGeneration = true;
                exportSettings.ExportColumnHeaders = false;
                exportSettings.ExportRowHeaders = false;
                DGVEExportingManager.Export(dataGridView2, exportDescription, false);

     

     

  •  08-27-2008, 12:20 AM 7830 in reply to 7824

    Re: ExportFileName doesn't appear to work

    Hi djohnson60618,

    Please, use the overload of the Export method of DGVEExportingManager class that accepts settings as parameter.

    string dir = "C:\\";
    string fileName = "test.xls";
    ExcelExportDescription exportDescription = new ExcelExportDescription();
    DGVEExcelExportSettings exportSettings = new DGVEExcelExportSettings();
    exportSettings.OpenFolderAfterGeneration =
    false;
    exportSettings.ExportFileName = dir + fileName;
    exportSettings.OpenFileAfterGeneration =
    true;
    exportSettings.ExportColumnHeaders =
    false;
    exportSettings.ExportRowHeaders =
    false;
    DGVEExportingManager.Export( dataGridView, exportDescription, exportSettings, false );

    If you have any other questions do not hesitate to contact us.

    Sincerely Yours
    Support Team

  •  08-29-2008, 8:19 AM 7895 in reply to 7830

    Re: ExportFileName doesn't appear to work

    Thanks, I clearly didn't notice the overload on the method.  I really appreciate your help.
View as RSS news feed in XML
Powered by Community Server (Personal Edition), by Telligent Systems