Showing posts with label action. Show all posts
Showing posts with label action. Show all posts

Friday, February 24, 2012

Cube Actions, how can I create a Command line action

In Analysis 2000 there was a command line action type, how can I do the same action in Analysis Services 2005?

Analysis 2000 command line action:

Defines an MDX statement that can be executed as a command line and displays the contents of the current directory:

"cmd /k dir"

Peter,

The DDL for AS2K5 still supports HTM and Command Line actions, but they are not exposed in the Business Intelligence Development Studio (BIDS). One work around that I have used is to create a URL action in BIDS and then save the cube definition and deploy it. Then you use SQL Server Management Studio to generate an ALTER CUBE script to an XMLA query window. Do a search on the script to find your action and then just change the type as show here:

Original script (segment with action definition)

<Action xsi:type="StandardAction">

<ID>Action</ID>

<Name>Command Line Action</Name>

<TargetType>Cells</TargetType>

<Type>URL</Type>

<Expression>"cmd /k dir"</Expression>

</Action>

Modified script

<Action xsi:type="StandardAction">

<ID>Action</ID>

<Name>Command Line Action</Name>

<TargetType>Cells</TargetType>

<Type>CommandLine</Type>

<Expression>"cmd /k dir"</Expression>

</Action>

Then just execute your script and the action type will be set to Command Line.

HTH,

- Steve

|||

Steve,

When I modify the script It still not works?

<Action xsi:type="StandardAction" dwd:design-time-name="f542b1b2-b2b6-4bf8-9903-63150db6ed15">
<ID>Action 1</ID>
<Name>CMD</Name>
<Description></Description>
<Caption></Caption>
<TargetType>Cells</TargetType>
<Target></Target>
<Condition></Condition>
<Type>CommandLine</Type>
<Application></Application>
<Expression>"cmd /k /dir"</Expression>
</Action>

When I change it back into URL the action works fine.

<Action xsi:type="StandardAction" dwd:design-time-name="f542b1b2-b2b6-4bf8-9903-63150db6ed15">
<ID>Action 1</ID>
<Name>CMD</Name>
<Description></Description>
<Caption></Caption>
<TargetType>Cells</TargetType>
<Target></Target>
<Condition></Condition>
<Type>Url</Type>
<Application></Application>
<Expression>"http://www.mywebsite.com"</Expression>
</Action>

|||

Peter,

I believe the problem is in the "Expression" you supplied to the command line action. It should be "cmd /k dir" and you have "cmd /k /dir"

<Expression>"cmd /k /dir"</Expression>

Cube action calling a stored procedure in AS2000

Hi,

I know a cube action can call a reporting services report thru an action,

I would like to know if it is posible to launch a stored procedure thru an action , if so what would be the best approach

Thank you

U

Yes, it should be possible. What do you want the sproc to do?

Chris

|||

I alredy have the stored procedure, The sproc will make an entry into a scheduler table for with its parameters to run at a later time,

Please let me know what needs to be done to implement this call

Thanks

U

|||

Just to be clear (I've only realised that you're talking about AS2K in this thread, and so not AS2005 sprocs) - you're talking about a SQL Server sproc here, aren't you?

What I would do is create a small ASP.Net app which kicks off this sproc, which you can pass parameters (like a member uniquename or something) to from through the url. You'd then create a url action in your cube to generate the appropriate url based on what the user clicked; after they'd done so they would see a web page open informing them that the entry in the scheduler table had been made successfully.

HTH,

Chris

|||

Not being an ASP.Net expert , is there anyplace where I can find code something similar to this being done

Thanks

U