Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a program from Crystal

Status
Not open for further replies.

franklin1232

IS-IT--Management
Aug 29, 2001
207
US
I would like to be able to have crystal execute a VB program everytime it runs. Our current ERP software only allows one crystal report to be associated with certian functions. They also provide there own viewer that isn't very good. It takes away almost all the useful function in the normal CRViewer. Here is the Idea

Select Case Customer
Case Customer1
Open application /customer1
Case Customer2
Open Applications /customer2
end select

This give me the ability to open any report format based on Customer.
 
An interesting idea. I'm interested to see if CR has the capability. I am unaware of it if it does.

I would recommend writing a VB application to do this. The VB application would (based on user input) start the report and then run the associated VB application.

mlmcc
 
I can't because or ERP will only allow us to associate certain file type with reports it runs. I have seen a few things that offer some promise, but I can't believe they don't just offer a open or run command. If not from crystal in a user fucntion dll.
 
You could very easily write a UFL to run an executable. However, the app would run on the PC where the report was being run - could be a problem if you're using Info or Enterprise.
I use a UFL that pops up a messagebox for debugging, running an executable instead would be simple. Andrew Baines
Chase International
 
I have never written a UFL. What does it take? Can I just write a VB activeX DLL and put a function in it that take a parameter.
 
Pretty much - take a look in the developer help file on the CD. There are quite a few samples on the web site too.
Once you know the naming convention needed it's very easy. Andrew Baines
Chase International
 
Interesting idea.

The naming convention is very important.

I can never remember what it is since I don't write too many of them I do know that capitalization counts in the name. I believe it must be uflXXXXX.vbp. VB will take care of compiling it correctly. The XXXXX can be anything you want.

good luck
mlmcc
 
The naming is CRUFLxxxx.dll but I am having some trouble getting crystal to find my function.
 
Drop it into windows\Crystal or Windows\system and use regsvr32.exe to register it. If you compiled it to the correct folder from within VB, there's no need to register.
Naming - name the dll CRUFLxxxx as Franklin says. The rest of the functionname will come from the class name and the function name within the class ie:
CRUFLxxxx with class class and function fn gives:
xxxxclassfunction withing crystal.
Andrew Baines
Chase International
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top