本帖最后由 linyimin 于 2024-11-14 11:13 编辑
你的是文本,是不是我们的导出方式不同造成的,我这边导出Excel代码如下
ExcelRenderingExtensionSettings ExcelSettings = new ExcelRenderingExtensionSettings();
ExcelSettings.MultiSheet = false;
ExcelSettings.Pagination = true;
if (savefileDlg.FileName.Contains("xlsx"))
ExcelSettings.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xlsx;
else
ExcelSettings.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xls;
string filePath = savefileDlg.FileName;
IRenderingExtension RenderingExtension = new ExcelRenderingExtension();
StreamProvider StreamProvider = new FileStreamProvider(new DirectoryInfo(System.IO.Path.GetDirectoryName(filePath)), System.IO.Path.GetFileNameWithoutExtension(filePath));
m_pageReportViewer.Render(RenderingExtension, StreamProvider, ExcelSettings.GetSettings());
|