zoukankan      html  css  js  c++  java
  • 程序通过ReportViewer对象来调用reporting services并导出pdf文件

    ReportViewer tempReportViewer = new ReportViewer();
    tempReportViewer.ProcessingMode = ProcessingMode.Remote;
    tempReportViewer.ServerReport.ReportServerUrl = new Uri("http://hczb-pc/ReportServer");//报表服务器
    tempReportViewer.ServerReport.ReportPath = "/HHD/HHD Satisfaction Survey Template";//报表地址,注意不加.rdl后缀

    try
    {
    Warning[] warnings;
    string[] streamids;
    string mimeType;
    string encoding;
    string extension;
    //string deviceInfo;
    byte[] bytes = tempReportViewer.ServerReport.Render(
    "PDF", null, out mimeType, out encoding, out extension,
    out streamids, out warnings);//读取报表流

    Response.Clear();
    Response.Buffer = true;
    Response.ContentType = "application/pdf";
    Response.AddHeader("content-disposition", "attachment;filename=" + "Report.pdf");
    Response.BinaryWrite(bytes);
    }
    catch (Exception ex)
    {

    HttpContext.Current.Response.Write(ex.Message);
    }

  • 相关阅读:
    Matlab产生随机序列,并采样
    LaTex的常用编辑
    傅里叶级数(FS)以及FT、DTFT、DFS和DFT
    uint32_t
    string
    const char * char const * char * const
    CString
    UNICODE与ANSI的区别
    MFC中输出string;
    assert
  • 原文地址:https://www.cnblogs.com/linxianfeng/p/4425400.html
Copyright © 2011-2022 走看看