hi
I use ExportService for exporting grid to excel
why does exporting work slow? for 4000 rows it takes 20 sec, it is not fine, Is there a way for have high speed in export to excel?
Thanks.
C#private void ShowPrintPreview(GridControl grid)
{
SaveFileDialog xlsDialog = new SaveFileDialog { Filter = "XLSX Files | *.xlsx", DefaultExt = "XLSX" };
bool? result = xlsDialog.ShowDialog();
if (result == true)
{
System.IO.Stream fileStream = xlsDialog.OpenFile();
link = new PrintableControlLink(grid.View as IPrintableControl);
link.PrintingSystem.ExportOptions.NativeFormat.Compressed = true;
link.ExportCompleted += link_ExportDownloadCompleted;
link.ExportStarted += link_ExportStarted;
link.PrintStarted += link_PrintStarted;
link.ExportServiceUri = "../ExportService1.svc";
link.CreateDocument(true);
link.CreateDocumentFinished += (s, args) =>
{
link.ExportToXlsx(fileStream, new XlsxExportOptions()
{
ExportMode = XlsxExportMode.SingleFile,
TextExportMode = TextExportMode.Value
}, true);
};
}
}
void link_PrintStarted(object sender, EventArgs e)
{
}
void link_ExportStarted(object sender, EventArgs e)
{
}
void link_ExportDownloadCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
if (e.Cancelled)
{
MessageBox.Show(e.Cancelled.ToString());
}
if (e.Error != null)
{
MessageBox.Show(e.Error.Message);
MessageBox.Show(e.Error.StackTrace);
}
else
MessageBox.Show("Export succeed!");
if (link != null)
link.Dispose();
}
Hello,
I'm afraid that there is no way to accelerate this operation.
You can try to build an XtraReport instead of exporting the grid control, but I can't guarantee that it will greatly increase the export performance in your case.
Are you sure? there is no way?
Hello,
There is no option to make the grid export faster. However, if you provide us with a sample illustrating the issue in action, I will forward it to our R&D team. They will examine your scenario in greater detail and check for a suitable solution.