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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PLZ Help me, Urgent, API calls in CR8,5

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
We have a application that runs on our network that loggs users. I must implement the username into my report.
How do i make this API call into Crystal??
I made a button in VB that looks like this :

Private Sub Command1_Click()
Set x = GetObject("", "AUAMain.AUAMainClass")
Ret = x.GetCurrentUserID()
Text1.Text = Ret
Set x = Nothing
End Sub

This one collects the username into a textbox.
Any ideas how i get this information to Crystal reports formula??

Im in desperate need for help / Kippe....
 
Create an activeX dll called CRUFLkippe
Declare a Class Module User
Then a function in the module:

Public Function name() As String
Set x = GetObject("", "AUAMain.AUAMainClass")
name = x.GetCurrentUserID()

Set x = Nothing

End Function
Compile this as a dll in windows\crystal. You will now have an extra function in the Crystal formula window called kippeUserName() that will return the name of your user Andrew Baines
Chase International
 
How do i get this to work in Crystal Viewer??

Thanks for your help :))

Best Regards / Mika
 
It will work only if the report is processed on the user's PC, otherwise you'll just get the name the service/process on the server is running under. Just add the function to a formula and bingo.

Only other option is if the user is logging into the database, then you can get the DBUser name via a SQL function. Andrew Baines
Chase International
 
This function works great with Crystal reports dev. edition.
BUT (alway a but) when i try to run the report with crystal report viewer i get a error "Run Time Error '406', Non-modal forms cannot be displayed in this host application from an Active X DLL, ActiveX Control or property page"

What to do, im in deep s**t if i don´t solve this...

Thanks alot for your help :))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top