muhuiru 发表于 2017-2-17 14:25:31

导出world

本帖最后由 Lenka.Guo 于 2017-2-17 16:23 编辑

请给我一个导出world的例子或者教程,谢谢

Lenka.Guo 发表于 2017-2-17 15:20:34

ExportFilter:
http://blog.gcpowertools.com.cn/post/exportreport.aspx

Rendering to Word// Provide the page report you want to render
GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"C:\Sample_PageReport.rdlx"));
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 .docx
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));
reportDocument.Render(wordRenderingExtension, outputProvider, wordSetting);         

muhuiru 发表于 2017-2-17 15:51:49

Lenka.Guo 发表于 2017-2-17 15:20
ExportFilter:
http://blog.gcpowertools.com.cn/post/exportreport.aspx



谢谢,我试试

muhuiru 发表于 2017-2-17 15:51:51

Lenka.Guo 发表于 2017-2-17 15:20
ExportFilter:
http://blog.gcpowertools.com.cn/post/exportreport.aspx



谢谢,我试试

Lenka.Guo 发表于 2017-2-17 15:53:03

ok

muhuiru 发表于 2017-2-21 10:18:39

你好,如果我现在有十条数据,要导出,能导出到一个word里吗

Richard.Ma 发表于 2017-2-21 17:49:18

已在另一个帖子回复
页: [1]
查看完整版本: 导出world