类(业务对象)未出现在 RDLC 的报表数据工具箱中 [英] Class (Business Object) not appearing in Report Data toolbox for RDLC

查看:47
本文介绍了类(业务对象)未出现在 RDLC 的报表数据工具箱中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在类库中创建了一个本地报表(作为嵌入式资源),我想使用现有的业务对象作为报表的数据源.当我尝试从报表数据"工具箱添加业务对象时,我看不到要选择的类.我注意到的是,如果业务对象是另一个类库中存在的另一个类的子类,那么它不会出现.有没有其他人看到这个?所以我试过的是这样的:

I have created a local report in a class library (as embedded resource) and I want to use the existing business objects as the data source for the report. When I try to add the business object from the Report Data toolbox I cannot see the class that I want to choose. What I've noticed is that if the business object is a subclass of another class which exists in a another class library then it doesn't appear. Has anybody else seen this? So what I've tried is this:

场景 1:

类库 1

  1. 报告文件夹 > Report1.rdlc
  2. BO 文件夹 > MyBO 和 MySuperClass
  3. 公开课 MyBO : MySuperClass

当我打开 Report1.rdlc 并尝试从报告数据"工具箱创建新对象数据源时,MyBO 类是可见的,我可以选择它.如果我将解决方案更改为此:

When I open up Report1.rdlc and try to create a New Object Data Source from the Report Data toolbox, MyBO class is visible and I can select it. If I change my solution to this:

类库 2namespace ClassLibrary2 { public class MySuperClass { ... } }

Class Library 2 namespace ClassLibrary2 { public class MySuperClass { ... } }

类库 1

  1. 报告文件夹 > Report1.rdlc
  2. BO 文件夹 > MyBO
  3. 公共类 MyBO : ClassLibrary2.MySuperClass

现在,当我尝试添加 MyBO 类时,它不会出现在报告数据"工具箱中.不幸的是,我正在使用一个产品,而我的 Business 对象必须是另一个类库中的超类的子类.

Now when I try to add the MyBO class it does not appear in the Report Data toolbox. Unfortunately I'm using a product and my Business objects have to be subclasses of the super class that is in the other class library.

有谁知道如何解决这个问题还是这是一个错误?哦,我正在使用 .Net 4 和 VS2010.谢谢.

Does anyone know how to fix this issue or is this a bug? Oh, I'm using .Net 4 and VS2010. Thanks.

亲切的问候

悉达多

推荐答案

我今天发现了同样的问题并跟踪到以下事实:当项目在调试模式下编译为 64 位时,数据源向导找不到任何事物.如果您切换到 x86,它们会神奇地出现.我猜向导是 32 位的.

I found the same issue today and tracked it to the fact that when the project is compiled as 64-bit in Debug mode that the Data Source Wizard does not find anything. If you switch to x86, they magically appear. I guess the Wizard is 32-bit.

我目前的解决方法是将调试模式设置为 x86,将发布设置为 x64.通过这种方式,我可以根据需要编辑数据源.最终版本运行没有任何问题.

My current work around is to set Debug mode to x86 and Release to x64. In this way, I can edit datasources as need be. The final Release doesn't have any problem running.

然而,我没有看到它依赖于一个子类.也许您的其他库将 Debug 设置为 x86,因此向导可以工作.

However, I did not see it dependent on being a sub-class. Maybe your other libraries have Debug set to x86 and hence the wizard works.

这篇关于类(业务对象)未出现在 RDLC 的报表数据工具箱中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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