dbTalk Databases Forums  

how to call a UDF in an Action defined at the server level?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss how to call a UDF in an Action defined at the server level? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jéjé
 
Posts: n/a

Default how to call a UDF in an Action defined at the server level? - 12-07-2004 , 05:15 PM






Hi,

I've created a custom VB.Net DLL which provide some custom functions.
These functions will be used to generate URL and HTML content for my actions
in my cubes.

How to load my library at the server side?
I can't execute "USE Library" before executing any MDX command, so my
library MUST be loaded by my server "at startup".

How to do this?

I've trie to create an action which is set to "On open" invocation which
execute the USE Library statement (action type=Instruction), but nothing
changes.

I've setup my DLL has this:
Here is the workaround you can try:
(1) Write a function with <ComClass> attribute
(2) Build with "Register for COM Interop"
(3) If move the dll/tlb from one machine to another, use RegAsm to register
the dll at new location.
Example C:\> regasm g:\udftest\classlibr ary1.dll
/tlb:g:\udftest\classlibrary.tlb /codebase


thanks for your help.

Jerome.



Reply With Quote
  #2  
Old   
Jéjé
 
Posts: n/a

Default Re: how to call a UDF in an Action defined at the server level? - 12-07-2004 , 05:20 PM






one point: my function works fine under the MDX Sample aplication...
so my DLL works fine...

"Jéjé" <willgart_A_ (AT) hotmail_A_ (DOT) com> wrote

Quote:
Hi,

I've created a custom VB.Net DLL which provide some custom functions.
These functions will be used to generate URL and HTML content for my
actions in my cubes.

How to load my library at the server side?
I can't execute "USE Library" before executing any MDX command, so my
library MUST be loaded by my server "at startup".

How to do this?

I've trie to create an action which is set to "On open" invocation which
execute the USE Library statement (action type=Instruction), but nothing
changes.

I've setup my DLL has this:
Here is the workaround you can try:
(1) Write a function with <ComClass> attribute
(2) Build with "Register for COM Interop"
(3) If move the dll/tlb from one machine to another, use RegAsm to
register
the dll at new location.
Example C:\> regasm g:\udftest\classlibr ary1.dll
/tlb:g:\udftest\classlibrary.tlb /codebase


thanks for your help.

Jerome.





Reply With Quote
  #3  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: how to call a UDF in an Action defined at the server level? - 12-07-2004 , 06:05 PM



Bring up the cube in the cube editor.
Add a calculated measure. Register the UDF in the calculated measure wizard.
Cancel out of the calculated measure wizard, but save the cube.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Jéjé" <willgart_A_ (AT) hotmail_A_ (DOT) com> wrote

Quote:
Hi,

I've created a custom VB.Net DLL which provide some custom functions.
These functions will be used to generate URL and HTML content for my
actions
in my cubes.

How to load my library at the server side?
I can't execute "USE Library" before executing any MDX command, so my
library MUST be loaded by my server "at startup".

How to do this?

I've trie to create an action which is set to "On open" invocation which
execute the USE Library statement (action type=Instruction), but nothing
changes.

I've setup my DLL has this:
Here is the workaround you can try:
(1) Write a function with <ComClass> attribute
(2) Build with "Register for COM Interop"
(3) If move the dll/tlb from one machine to another, use RegAsm to
register
the dll at new location.
Example C:\> regasm g:\udftest\classlibr ary1.dll
/tlb:g:\udftest\classlibrary.tlb /codebase


thanks for your help.

Jerome.





Reply With Quote
  #4  
Old   
Jéjé
 
Posts: n/a

Default Re: how to call a UDF in an Action defined at the server level? - 12-07-2004 , 06:44 PM



when I try to register my DLL through the "register" button, I get an error
Unable to add library reference
E:\SampleLibrary\bin\Debug\SampleLibrary.tlb.
The operation has failed because of an error in the COM component -
unknown error The system cannot find the file specified.

I've followed some google's article and other article on the web to create
my component.
and the component works fine using the MDX sample application.

any idea?

"Dave Wickert [MSFT]" <dwickert (AT) online (DOT) microsoft.com> a écrit dans le
message de news: OR4wYmL3EHA.1152 (AT) TK2MSFTNGP14 (DOT) phx.gbl...
Quote:
Bring up the cube in the cube editor.
Add a calculated measure. Register the UDF in the calculated measure
wizard.
Cancel out of the calculated measure wizard, but save the cube.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no
rights.

"Jéjé" <willgart_A_ (AT) hotmail_A_ (DOT) com> wrote in message
news:O69rfJL3EHA.936 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Hi,

I've created a custom VB.Net DLL which provide some custom functions.
These functions will be used to generate URL and HTML content for my
actions
in my cubes.

How to load my library at the server side?
I can't execute "USE Library" before executing any MDX command, so my
library MUST be loaded by my server "at startup".

How to do this?

I've trie to create an action which is set to "On open" invocation which
execute the USE Library statement (action type=Instruction), but nothing
changes.

I've setup my DLL has this:
Here is the workaround you can try:
(1) Write a function with <ComClass> attribute
(2) Build with "Register for COM Interop"
(3) If move the dll/tlb from one machine to another, use RegAsm to
register
the dll at new location.
Example C:\> regasm g:\udftest\classlibr ary1.dll
/tlb:g:\udftest\classlibrary.tlb /codebase


thanks for your help.

Jerome.







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.