如何在集成在.Net Windows窗体应用程序中的Acrobat Reader中显示RDLC报告. [英] How to show RDLC reports in Acrobat Reader which is integrated in .Net Windows Forms Application.

查看:63
本文介绍了如何在集成在.Net Windows窗体应用程序中的Acrobat Reader中显示RDLC报告.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要在Acrobat PDF Viewer中显示RDLC报告,该报告应作为ActiveX控件集成到.net Windows Forms应用程序中的表单中. 我在Web应用程序中使用了相同的概念,并且相同的代码如下...

Hi,

I need to show a RDLC report in Acrobat PDF Viewer which should be integrated as activex control in a form in .net Windows Forms application.
Im using the same concept in web application, and the code for the same is as follows...

dvpdf.Visible = true;
dvReport.Visible = false;
Warning[] warnings;
string[] streamIds;
string mimeType = string.Empty;
string encoding = string.Empty;
string extension = string.Empty;
byte[] bytes = this.ReportViewer1.LocalReport.Render("PDF", null, out mimeType, out encoding, out extension, out streamIds, out warnings);
String strfilename = System.IO.Path.GetRandomFileName();
using (FileStream fs = new FileStream(Server.MapPath("~/pdfoutput/") + strfilename + ".pdf", FileMode.Create))
{
fs.Write(bytes, 0, bytes.Length);
}
StringBuilder sb = new StringBuilder();
sb.Append("<object data='" + "pdfoutput/" + strfilename + ".pdf" + "' type='application/pdf' width='916' height='470'>");
sb.Append("</object>");
this.dvpdf.InnerHtml = sb.ToString();




由此,它会以Acrobat Reader中的PDF格式显示报告,该报告已安装在计算机上.

现在,如何在Windows窗体应用程序中完成此操作.

请帮帮我.

提前致谢.问候
Sri




from this it is showing the report in PDF format in Acrobat Reader which is installed on the machine.

Now, how it can be done in the windows forms application.

Please help me.

Thanks in advance. Regards
Sri

推荐答案

您已经知道如何将报告呈现为PDF,因此您已经过了一半.
您应该能够使用正在使用的ActiveX组件来传递文件路径并显示保存的文件.

因此,您的方法应为:
1)生成文件路径
2)在该位置将RDLC渲染为PDF
3)将路径传递到有问题的Activex控件.

请注意,如果您只是黑客入侵某个非目的的内容,则可能违反了使用协议(即,如果您只是在Adobe DLL中存根,则是不行). .NET有第三方的PDF控件,因此您可以轻松获得便宜或免费的PDF控件.

干杯.
You already know how to render the report as a PDF, so you''re over halfway there.

You should have the ability to use the ActiveX component you''re working with to pass in a file path and display a saved file.

Therefore, your approach should be:
1) generate a filepath
2) render the RDLC to PDF at that location
3) pass the path to the activex control in question.

Note that if you''re just hacking in something not purposed for this you might be violating a use agreement (i.e., if you''re just stubbing in an Adobe DLL, this is a no-no). There are 3rd party PDF controls for .NET, so you shouldn''t have trouble getting one for cheap or free.

Cheers.


这篇关于如何在集成在.Net Windows窗体应用程序中的Acrobat Reader中显示RDLC报告.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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