ActiveReports 升级错误
我刚刚从 ActiveReports 2.0 升级到 3.0。所有 rpx 文件均已转换为 *.vb 文件。 ActiveReports 项目具有这样的类层次结构:
*.vb 与设计器 -> PrintBase.vb-> ActiveReport3
当我打开任何 *.vb 文件时,出现此错误:
无法为该文件显示设计器,因为无法设计其中的任何类。设计者检查了文件中的以下类: xxx --- 无法加载基类“PrintBase”。确保已引用程序集并且已构建所有项目。
调用堆栈: 在 System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager 经理) 在 System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager 管理器) 在 Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager 序列化管理器) 在 System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
然后我浏览了 PrintBase.vb。没有编译错误。然后我将其中一个 *.vb 文件修改为:
Hello.vb -> ActiveReport3
设计器工作没有任何问题。 PrintBase 有相当多的代码。为了简化调试,我创建了一个名为 BasePrint 的新 .vb 文件,该文件继承自 ActiveReport3。因此,层次结构回到:
Hello.vb ->基本打印 -> ActiveReport3
然后我又看到了上面同样的错误。根据我的调试,AR3设计器似乎不允许.vb文件从基类继承。但我不太确定。顺便说一句,ActiveReports 项目是 vb.net。 VS 2008 项目解决方案下还有其他 C# 项目。 VB.NET 项目和 C# 的混合与迁移/升级过程有什么关系吗?
谢谢。
I just upgraded from ActiveReports 2.0 to 3.0. All rpx files have been converted to *.vb files. The ActiveReports project has this class hierarchy:
*.vb with designer -> PrintBase.vb -> ActiveReport3
When I opened any of the *.vb files, I got this error:
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: xxx --- The base class 'PrintBase' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
Call stack:
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
Then I went through PrintBase.vb. There was no compile error. Then I modified one of the *.vb files to this:
Hello.vb -> ActiveReport3
The designer worked without any problems. The PrintBase has quite a bit of code. To simplify the debugging, I created a new .vb file called BasePrint that inherits from ActiveReport3. So, the hierarchy is back to:
Hello.vb -> BasePrint -> ActiveReport3
Then I saw the same error above again. It seems like AR3 designer does not allow .vb files to inherit from a base class according to my debugging. But I am not quite sure. BTW, the ActiveReports project is vb.net. There are other C# projects under a VS 2008 project solution. Is the mixing of VB.NET projects and C# have anything to do the miagration / upgrade process?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实上,ActiveReports 3.x 设计器中的升级实用程序不支持类样式继承。但是,升级完成后,您应该能够将基类设置为错误(按照您描述的方式),并且设计者应该安全地忽略它。如果您仍然遇到问题,请尝试关闭项目,进行清理(删除可能引用旧 PrintBase 类的旧程序集)&关闭 Visual Studio 并再次重新打开它以重新开始。
您可以在以下页面找到有关将报表从 ActiveReports 2.x 升级到 ActiveReports 3.x 的更多信息: 链接文本
但是,在这种情况下,您似乎正在使用继承来共享一些实用方法,也许还有一些状态(例如,可能在类级字段中)。为此,最好让您的报表直接从 ActiveReport3 继承,并使用“BasePrint”作为您的报表调用函数的一种实用程序类。通常,除了必须在方法调用前加上该方法的名称前缀之外,这没有任何缺点。相应的 BasePrint 实例/变量名称,它简化了您描述的场景中与 ActiveReports 设计器的处理。
但是,ActiveReports 确实支持视觉继承,允许基础报表与派生报表共享控件。有关如何使用此功能的更多信息,请访问以下位置:http://www .datadynamics.com/Help/ARNET3/ar3tskInheritance.html。但是,我想强调,这是一种与您正在使用的不同的继承风格,因此它可能不适用于您的需要。
另外,您应该尝试再次转换,而无需使用 C# 和 VB 项目的组合解决方案。我不知道这是一个问题,但这肯定不是转换器最常见的使用方式,并且可能会使事情变得复杂。
最后,您应该知道 ActiveReports 6 现已可用,您可能需要考虑尝试该版本。
如果您仍然遇到任何问题,请联系我们的支持团队:[电子邮件受保护] 或使用我们的公共表单,该表单有许多 ActiveReports 专家每天在以下链接进行监控:
http://www.datadynamics.com/forums/73/ShowForum.aspx - ActiveReports 3 论坛
http://www.datadynamics.com/forums/82/ShowForum.aspx - ActiveReports 6 论坛
Indeed, the class-style inheritance was not supported by the upgrade utility in the ActiveReports 3.x designer. However, after an upgrade is complete you should be able to put the base class bad (the way that you described) and the designer should safely ignore it. If you're still having problems try to close the project, do a clean (delete the old assemblies that might be referncing the old PrintBase class) & close visual studio and reopen it again to get a fresh start.
You can find more information about upgrading reports from ActiveReports 2.x to ActiveReports 3.x at the following page: link text
However, it seems you are using inheritince in this case to share some utility methods and maybe some state (e.g. in class-level fields maybe). For this it is best if you have your reports inherit directly from ActiveReport3 and use "BasePrint" as a sort of utility class that your reports call functions in. Normally this has no disadvantage other than having to prefix the method calls with the name of the corresponding BasePrint instance/variable name and it simplifies dealing with ActiveReports designer in the scenario you describe.
However, ActiveReports does support a visual inheritence that allows a base report to share controls with a derived report. There is more information on how to use this feature at the following location: http://www.datadynamics.com/Help/ARNET3/ar3tskInheritance.html. However, I want to stress that this is a different style of inherience than you are using so it may not be applicable to what you need.
Also, you should try to convert again without having a combined solution with C# and VB projects. I don't know that this is a problem but it is certainly not the most common way the converter is used and may be complicating things.
Finally, you should be aware that ActiveReports 6 is now available and you may want to consider trying out that version.
If you continue to have any problems please contact our support team at [email protected] or use our public forms that have many ActiveReports experts monitoring them every day at the following links:
http://www.datadynamics.com/forums/73/ShowForum.aspx - ActiveReports 3 Forum
http://www.datadynamics.com/forums/82/ShowForum.aspx - ActiveReports 6 Forum