从Crystal Report引用自定义程序集 [英] Referencing a custom assembly from Crystal Report

查看:67
本文介绍了从Crystal Report引用自定义程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,您好。



我有一个.dll文件,其中有一个名为Class1的类。 Class1包含一个名为'Convert'的方法,它是一种带有十进制输入参数的Public Static String。



在我的项目中,我使用crystal report进行报告。在我的报告中,我想使用Class1的这种方法('转换')。



请告诉我怎么做。



非常感谢。

Hello my dear friends.

I have a .dll file that a class named 'Class1' is in it. Class1 contains a method named 'Convert' that it is a type of Public Static String with a decimal input parameter.

In my project I use crystal report for reporting. In my report I want to use this method ( 'Convert' ) of Class1.

Please tell me how can I do it.

Thanks a lot.

推荐答案

这在很大程度上取决于您使用的版本,但自定义函数位于用户函数库中(UFL)用水晶术语表示。一个教程开始:创建用户函数库 [< a href =http://msdn.microsoft.com/en-us/library/ms227603(v=vs.90).aspx\"target =_ blanktitle =New Window> ^ ]
This highly depends on the version you're using, but custom functions are located in a User Function Library (UFL) in Crystal terms. One tutorial to start with: Creating a User Function Library[^]


您好,



我遇到了与此主题相同的问题。我在使用Crystal Reports 13(适用于VS.NET)的Visual Studio 2010上尝试此操作。我完成了教程中描述的所有步骤:



http://msdn.microsoft.com/en-US/library/ms227661(v = vs.80) [ ^ ]



同样在本电子书中,第390页:



VS2005_W​​alkthroughs.pdf [ ^ ]



但是我的类和函数没有出现在Crystal Reports Designer中(公式工作室>函数>附加函数)。我验证了我的DLL,名为CRUFLICE.DLL,已在COM注册。我有一个较旧的VB6 DLL,如果我用COM注册它,那么它的功能就会显示出来。所以我重命名了我的VB.NET类,方法,汇编,以匹配旧的DLL,但仍然没有运气。我会做C#但新的.NET自定义函数将取代旧的VB6自定义函数,所以我在VB.NET中这样做,所以可以重用一些旧的代码。



我的新DLL长度为8个字母,以CRUFL前缀开头。我的类是ComVisible,有一个Guid并实现了一个接口。我的函数是公共的并返回一个String。我已经通过Visual Studio构建选项注册了DLL,并直接使用regasm和gacutil。我还缺少什么?



谢谢。
Hello,

I have the same problem described in this thread. I am trying this on Visual Studio 2010 with Crystal Reports 13 (for VS.NET). I have done all the steps as described in tutorial:

http://msdn.microsoft.com/en-US/library/ms227661(v=vs.80)[^]

Also in this ebook, page 390:

VS2005_Walkthroughs.pdf[^]

However my class and functions are not showing up in Crystal Reports Designer (Formula Workshop > Functions > Additional Functions). I verified that my DLL, named CRUFLICE.DLL, is registered with COM. I have an older VB6 DLL which, if I register it with COM, then it's functions do show up. So I renamed my VB.NET class, methods, assembly, to match the old DLL and still no luck. I would do C# but the new .NET custom functions are going to replace the old VB6 custom functions, so I am doing it in VB.NET so can reuse some of the old code.

My new DLL is 8 letters long starting with CRUFL prefix. My class is ComVisible and has a Guid and implements an interface. My functions are public and return a String. I have registered DLL through Visual Studio build option and directly with regasm and gacutil. What else am I missing?

Thanks.


这篇关于从Crystal Report引用自定义程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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