如何将rdlc报告呈现为.docx而不是doc [英] How to render rdlc report to .docx not as doc

查看:97
本文介绍了如何将rdlc报告呈现为.docx而不是doc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何将RDLC报告呈现为.docx而不是doc。我已经尝试了以下代码,但它没有用。所以请帮我解决这个问题。

Hi,
How to render the RDLC report to .docx not as doc. I have tried out the following code but it didnt work. So please help me to solve the issue.

var report = new LocalReport();
RvQpTemplate.LocalReport.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource());
RvQpTemplate.DataBind();

Byte[] mybytes = RvQpTemplate.LocalReport.Render("WORD", null,
                out extension, out encoding,
                out mimeType, out streams, out warnings);
Response.ClearHeaders();
Response.ClearContent();
Response.Buffer = true;
Response.Clear();
Response.ContentType = contentType;
Response.AddHeader("Content-Disposition", "attachment; filename="+test.docx);
Response.BinaryWrite(mybytes);
Response.Flush();
Response.Close();
Response.End();

推荐答案

使用WORDOPENXML而不是WORD调用渲染方法
Call render method with WORDOPENXML instead of WORD


这篇关于如何将rdlc报告呈现为.docx而不是doc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆