本帖最后由 Felix.Li 于 2023-3-28 10:10 编辑
請問 AR16 產生Word 格式的報表,
我在產生doc 格式 (wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.HTML)時,都正常顯示沒有跑版,
但在使用 docx (wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.OOXML) 時,就整個表格都跑不出來,
也整個大跑版 如附件
GrapeCity.ActiveReports.Export.Word.Page.Settings wordSetting = new GrapeCity.ActiveReports.Export.Word.Page.Settings();
wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.OOXML;
//wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.HTML;
wordSetting.UseMhtOutput = true;
// Set the rendering extension and render the report.
GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension wordRenderingExtension = new GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension();
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(new DirectoryInfo(Path.GetDirectoryName(path)), Path.GetFileNameWithoutExtension(path));
// Overwrite output file if it already exists
outputProvider.OverwriteOutputFile = true;
rpt.Document.Render(wordRenderingExtension, outputProvider, wordSetting);
|