Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Additional Function not showing up.

Posted on 2002-04-05
8
Medium Priority
?
329 Views
Last Modified: 2012-06-22
Hi Experts
 
 I have been trying to add my own User Defined Function to Crystal 8.5 with no success.  I have compiled my VB code as a dll and placed this dll in the WINNT\Crystal directory and registered it. At this point I would expect it to be visible under 'Additonal Funtions' in Funtions in the Formula editor.  We have been able to do this in verions 7 of Crystal but ever since we upgraded we have not been able to get it to work.

Here is my VB code.  It is one I found off of Crystals web site.

Option Explicit
Public UFPrefixFunctions As Boolean

Private Sub Class_Initialize()
  UFPrefixFunctions = False
End Sub

Public Function DateToString(date1 As Date) As String
     DateToString = Format(date1, "Long Date")
End Function


Does anyone know what I am missing?

Thanks

0
Comment
Question by:Brighton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 6922389
I assume since you have done this before you are naming the dll correctly.  It must be CRUFLxxx.DLL.

mlmcc
0
 
LVL 1

Author Comment

by:Brighton
ID: 6925369
Yes.  The program listed above is compiled and registered as CRUFLTraining.DLL in my WINNT\Crystal directory.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 6925544
What name are you looking for in the Additional Functions List.

CR renames your function.  As a guess look for

TrainingDateToString

mlmcc
0
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 
LVL 1

Author Comment

by:Brighton
ID: 6925715
Yes, I was expecting to see TrainingDateToString or something with Training or even DateToString in the name.
I have looked at all the additonal functions and none of them are even close to what I was looking for.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 6926226
I just created an ActiveX DLL using your code and compiled it in VB.  I compiled it to my library directory (not windows\system) and CR recognized it immediately.

My first attempt didn't work (wouldn't compile) but when I started from a fresh project it did.

Suggest you create a new ActiveX dll project, add a class module, then type in your code and make the dll and see if it is rcognized.

mlmcc
0
 
LVL 1

Author Comment

by:Brighton
ID: 6926525
I redid the DLL as you suggested but still no luck.  Is there a reference that needs to be check in VB?

Thanks
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 800 total points
ID: 6929205
I didn't add any references or components.
Here is what it defaulted

The Project Properties
General Tab
project type  -  ActiveX DLL
startup object - (none)
Project name - cruflTraining
Upgrade ActiveX controls - checked
Threading model - Apartment Threaded

Make Tab
Application Title - CRUFLTraining
Remove information about unused ActiveX controls - checked

Compile Tab
Compile to Native code - selected
Optimize for fast Code - selected

Component Tab
Project compatubility - selected
cruflTraining.dll in the text box


Project References
VB for Applications
VB runtime objects and procedures
VB objects and procedures
OLE Automation


Project Components
Designers Tab
Data Environment
Data Report
DHTML Page
WebClass


mlmcc
0
 
LVL 1

Author Comment

by:Brighton
ID: 6942210
Thanks!  It appears to be case sensitive. Once I changed the project name to lowercase and recompiled it worked but that doesn't make sense.  Why just changing the project name and nothing else make it work?  Thanks Again.
0

Featured Post

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question