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
770
Dialogs must be user-initiated Export to excel
posted

Hi,

   I m using export to excel. Its working fine if records in datagrid are less. But if records are large e.g above 2000 rows its not working.Giving messaga Dialogs must be user-initiated Export to excel.

My code is as below

 

 

 

SaveFileDialog dialog = new SaveFileDialog { Filter = "Excel files|*.xls", DefaultExt = "xls" };

 

bool? showDialog = dialog.ShowDialog();

 

if (showDialog == true)

{

 

using (Stream exportStream = dialog.OpenFile())

    {

             dataWorkbook.Save(exportStream);

               exportStream.Close();

     }

}

 

 

So please give solution for large data

 

Thanks,

Nandu

 

 

 

Parents Reply Children