UFL
User Function Libraries (UFLs)
 
Creating your own Seagate Crystal Report functions are very easy. Through the use of Visual Basic one can create functions and call them through Crystal Reports.

Here is how to create your own Visual Basic function(s) that can be used by Crystal Reports Designer's Formula.

Requirements:

  • Using a 32bit version of Seagate Crystal Report, version 6 and 7 work perfectly, but version 5 can be used but passing NULL values may not work. (See Problems on menu)
  • Use Visual Basic 4 (32bit), 5 or 6.
  • U2LCOM.DLL in the directory \windows\crystal or in \CRW6-32. If you do not have the DLL it can be downloaded.  [Download U2LCOM.DLL]

Creating A Visual Basic Function:

  • Load up Visual Basic and a new ActiveX DLL Project.
  • Select Project1 in the Project Explorer window and in the properties window change the name of the project to something that begins with CRUFL followed by three characters. The first character must be a letter. Example: CRUFLONE.
  • Select Class1 in the Project Explorer window and in the properties window change the name to anything you want.
  • Create your function. Note: A easy way to create a function is by using the menu: Tools|Add Procedures...
  • Save your work.
  • Then make the DLL through the menu: File|Make CRUF???.DLL

Using Your Function In Crystal Reports:

  • Move our DLL to \windows\crystal directory.
  • Load up Seagate Crystal Reports Designer.
  • Open an report.
  • Select the menu Insert|Formula Field.
  • Give the Formula a name.
  • Scroll down the Function window until you get to the Additional Functions.
  • Your function will be there, in the format
    <ProjectName><ClassName><FunctionName>()
    Note: See Enhancement if you want only the <FunctionName> to appear.

Copyright 2002 VisualTech Components. All Rights Reserved.