C1Print.RenderToStream ( Error in windows server 2016 )

Posted by: kanazzang on 14 March 2018, 1:29 pm EST

    • Post Options:
    • Link

    Posted 14 March 2018, 1:29 pm EST

    C1Report.RenderToStream was no error in Windows 7, Windows Server 2012 R2.

    but

    The same thing happens on Windows server 2016 with an EndOfStream error.

    How should we solve this problem?

    Thanks in advance

    — Source Code —

        public void MakeDoc()
        {
            try
            {
                C1.C1Report.C1Report rep = C1ReportViewer.CreateC1Report();
                rep.Load(Server.MapPath("~/Report/" + HttpUtility.ParseQueryString(Request.Url.Query).Get("Path") + ".xml"), 
                    HttpUtility.ParseQueryString(Request.Url.Query).Get("ReportName"));
    
                DataSet ds = rpt;  
    
               rep.DataSource.Recordset = ds.Tables[0];
    
                if (rep.IsBusy)
                {
                    return;
                }
    
                using (MemoryStream output = new MemoryStream())
                {
                    rep.RenderToStream(output, C1.C1Report.FileFormatEnum.PDF);
    
                    byte[] bytes = output.ToArray();
    
                    string fileName = sessionName + ".pdf";
    
                    Response.Clear();
                    Response.ContentType = "application/pdf";
                    Response.AddHeader("Content-Disposition", "filename=\"" + Server.UrlPathEncode(fileName) + "\"");
                    Response.AddHeader("Content-Length", bytes.Length.ToString());
                    Response.BinaryWrite(bytes);
                    Response.Flush();
                    
                }
            }
            catch (Exception ex)
            {
                this.ErrorMessageAlert(this, ex);
            }
        }
    }
    
  • Posted 20 March 2018, 3:08 pm EST

    Hi,

    We are sorry for the delayed response.

    We are looking into this. We will update you soon.

    ~Manish

  • Posted 29 March 2018, 1:37 am EST

    Hi,

    We are sorry for the delay.

    We are getting some issue while deploying sample application on Win16 server. In the meantime, if you have any demo application.

    please share with us for further investigation in case…

    ~Manish

  • Posted 2 April 2018, 4:21 pm EST

    Hi,

    We are extremly sorry for the delayed response.

    We are unable to replicate the issue at our end. Please find the attached sample used for replicating issue.

    The sample gets work fine with WinServer 12/16.

    ~Manish

    ReportStream.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels