您的位置:首页 > 其它

report from reportviewer without viewing the control

2009-09-03 11:41 246 查看
It exports both xls and pdf. Try that.

private void ExportData(LocalReport report, string extension)
{
// Out params to pass into the Render method
Microsoft.Reporting.WebForms.Warning[] warnings;
string[] streamids;
string mimeType, encoding, extensionOut;

report.EnableHyperlinks = true;
byte[] bytes = report.Render(extension, null, out mimeType,
out encoding, out extensionOut,
out streamids, out warnings);

Response.Clear();
Response.ContentType = mimeType;
Response.AppendHeader("Content-Disposition",
string.Format("attachment; filename={0}.{1}",
DateTime.Now.ToString("yyyyMMdd"), extensionOut));
Response.BinaryWrite(bytes);
Response.End();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐