这是我用于将某些数据导出为excel的代码:
var sd = new SaveFileDialog { Filter = "Excel File (*.xl)|*.xls" };
if (sd.ShowDialog() == DialogResult.OK)
{
sw = new FileStream(sd.FileName, FileMode.Create);
GridEXExporter grdListExporter = new GridEXExporter();
grdListExporter.IncludeFormatStyle = true;
grdListExporter.IncludeHeaders = true;
grdListExporter.GridEX = grid;
grdListExporter.Export(sw);
}
当我单击导出按钮时,出现以下错误:
Visual Styles-related operation resulted in an error because visual styles are currently disabled in the client area.
我还有另一个空白,使用与我提到的相同的代码,这没有问题!但是对于特定的空缺,我会收到此错误。有人可以帮忙吗?
更新
我在if (sd.ShowDialog() == DialogResult.OK)
行出现错误