RDCL报告到临时PDF然后打印 [英] RDCL report to temp PDF then print

查看:94
本文介绍了RDCL报告到临时PDF然后打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们我有RDCL报告我想将此报告转换为Temp PDF,然后打印此临时PDF 5次,我使用下面的代码,它将报告视为PDF但是当我打印

看起来像字节而且不清楚,请帮忙吗?



我尝试过:



guys i have RDCL report i want to convert this report to Temp PDF, then print this temp PDF 5 times , i am using the below code, it is view the report as PDF but when i print
appear like bytes and not clear , any help please ?

What I have tried:

 ReportViewer1.ProcessingMode = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = "Doctor_form.rdlc";
            this.ReportViewer1.LocalReport.SetParameters(parameters);
            ReportViewer1.LocalReport.Refresh();
            Warning[] warnings;
            string[] streamIds;
            string mimeType = string.Empty;
            string encoding = string.Empty;
            string extension = string.Empty;

            byte[] bytes = ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
Response.Buffer = true;
            Response.Clear();
            Response.ContentType = mimeType;
            Response.BinaryWrite(bytes);
            Response.Flush();

推荐答案

它在浏览器中出现了字节,因为你没有告诉浏览器是什么它正在获得的内容类型。您将ContentType设置为空字符串而不是application / pdf。
It's coming up bytes in the browser because you're not telling the browser what type of content it's getting. You're setting the ContentType to an empty string instead of "application/pdf".


这篇关于RDCL报告到临时PDF然后打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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