devexpress gridview exporttoxls/xlsx无法正常工作
我目前正在尝试将GridView1导出到XLS和XLSX文件。我的问题是,导出不起作用。我只是得到一个空文件和以下错误:
,我可以找到有关此错误的任何内容。.
我的代码非常基本:
Case "barXLS"
fileName = $"C:\Temp\{dt.Year}{dt.Month}{dt.Day}{dt.Second}_Export.xls"
GridView1.ExportToXls(fileName)
Case "barXLSX"
fileName = $"C:\Temp\{dt.Year}{dt.Month}{dt.Day}{dt.Second}_Export.xlsx"
GridView1.ExportToXlsx(fileName)
但是我尝试了很多设置,用于gridview和xlsexportoptionsex,但是他们都没有工作。当我尝试打开XLS表格时,我会发现一个错误,说该文件已损坏。
我真的很感谢您的帮助,谢谢!
I´m currently trying to export my GridView1 to an XLS- and XLSX-File. My Problem is, that the export is not working. I just get an empty file and the following error:
And I can´t find anything regarding this error..
My code is pretty basic:
Case "barXLS"
fileName = quot;C:\Temp\{dt.Year}{dt.Month}{dt.Day}{dt.Second}_Export.xls"
GridView1.ExportToXls(fileName)
Case "barXLSX"
fileName = quot;C:\Temp\{dt.Year}{dt.Month}{dt.Day}{dt.Second}_Export.xlsx"
GridView1.ExportToXlsx(fileName)
But I tried a lot of settings for the GridView and for XlsExportOptionsEx but none of them worked. When I try to open the XLS-Sheet I get an error saying that the file is corrupted.
I would really appreciate your help, thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在列定义中添加了以下行:
之后,导出按预期工作。
I added the following line to my column-defintions:
After that the export worked as expected.