如何使用LocalReport.LoadReportDefinition() [英] How to use LocalReport.LoadReportDefinition()

查看:129
本文介绍了如何使用LocalReport.LoadReportDefinition()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些帮助。我找到了创建传递给LoadReportDefinition所需的TextReader的代码。但是,我正在努力的部分是GetManifestResourceStream,它将RDLC加载到流中。我在一个Web应用程序中运行它并且
不能在我的生活中找出rdlc资源的名称。

I need a little help. I found code to create the TextReader needed to pass to LoadReportDefinition. However, the part I am struggling with is the GetManifestResourceStream that loads the RDLC into a stream. I am running this in a web application and can not for the life of me figure out the name of the rdlc resource.

stream = System.Reflection。

stream = System.Reflection.

程序集 。GetExecutingAssembly()。GetManifestResourceStream( " MyReport.rdlc"

我知道我需要在MyReport.rdlc前面有一个名称空间,我怎么知道它是什么?我试过了这个项目的名字。我试过

 

GetManifestResourceNames()返回0.任何人都知道我哪里出错了?我也试过这个.GetType()。Assembly.GetManifestResourceStream(" x"),没有运气。

GetManifestResourceNames() which returns 0. Anyone have an idea of where I am going wrong? I also tried this.GetType().Assembly.GetManifestResourceStream("x"), no luck.

谢谢你提前。

推荐答案

 

根据您的描述,您需要指定一个嵌入式是单独的程序集的报表。 ReportViewer控件。当您尝试通过
发布的表达式获取报表时,程序集的命名空间需要传递给GetManifestResourceStream方法,其报表名称为
Namespace.Myreport .rdlc 。但是,现在命名空间是未知的,对吗? 

Based your description, you need to specify a report which embedded is a separate assembly to the ReportViewer control. And when you trying to get the report by the expression you posted, the namespace of the assembly is required to pass to the GetManifestResourceStream method with the report name like Namespace.Myreport.rdlc. However, now the namespace is unknown, correct? 

 

如果是,我们的问题是如何获得程序集的命名空间,你同意吗?请给我一个确认,我仍然会继续努力。或者,如果我误解了,请让我知道

 

谢谢,

Tony Chain


这篇关于如何使用LocalReport.LoadReportDefinition()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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