报表上可以自动换行。导出WORD后就不行了
我用下面这串语法来用来上下句的换行连接,在本地运行查看是会换行的,但是导出WORD后缺不会换行。我想达到换行的效果,应该怎么写?怎么实现导出WORD后也能自动换行。您好,你导出用的是哪个写法写的。
您用下面这种导出方法试试
GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);// Create an output directory.System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyWord");outputDirectory.Create();// Provide settings for your rendering output.GrapeCity.ActiveReports.Export.Word.Page.Settings wordSetting = new GrapeCity.ActiveReports.Export.Word.Page.Settings();// Set the FileFormat property to .OOXML.wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.OOXML;// 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(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));// Overwrite output file if it already exists.outputProvider.OverwriteOutputFile = true;reportDocument.Render(wordRenderingExtension, outputProvider, wordSetting);
KearneyKang 发表于 2017-9-29 15:52
您好,你导出用的是哪个写法写的。
您用下面这种导出方法试试
GrapeCity.ActiveReports.PageReport repor ...
这个写在哪里啊???? 如果您的导出是自定义的,并且导出代码是在后台实现的,替换哪里的导出代码就可以。
如果您的导出是Webviewer或者Html5Viewer上集成的,就不能修改。因为原则上导出的样子是跟预览的结果一样的。
您换这种表达式试试:
=Fields!产品ID.Value & chr(10) &Fields!产品名称.Value
页:
[1]