List of Snowflake.net Events

 

 

In the following table are listed all events used in the Snowflake.net 3.0 control.

 

 

Event

Description

BeforeUIAction

BeforeUIAction is fired when the user performs a UI action but before the UI action is completed. This even can be wired to intercept the user action by returning the cancel message through the event arguments.

 

Here is an example:

 

private void Snowflake1_BeforeUIAction(object sender, SnowflakeNS.Snowflake.BeforeUIActionEventArgs e)

{

if (e.Action=="EditSlice" & e.ActionPara=="[Gender]")

{

e.Cancel=true;

e.CancelExplanation="Performed action is forbidden";

// CancelExplanation will be displayed on the top of the Snowflake control

// if VerboseErrors desgin-time property is set to true

}

}

 

AfterUIAction

AfterUIAction event is fired once the users action is completed. This event can be wired to perform additional actions or display information once the users action is complete.

 

Here is an example:

 

private void Snowflake1_AfterUIAction(object sender, SnowflakeNS.Snowflake.AfterUIActionEventArgs e)

{

if (e.QueryChanged)

this.TextBox1.Text+="! ";

this.TextBox1.Text+=e.Action + " " + e.ActionPara+"\n";

}

 

BeforeRender

BeforeRender exposes Snowflake DataTable object for read and modification.

Usage example: Following example adds asterisk at the end of data cells, changes fore color of member cells and back color of admin cells (paging, sorting etc.)

private void Snowflake1_BeforeRender(object sender, SnowflakeNS.Snowflake.BeforeRenderEventArgs e)

{

foreach (TableRow tr in e.DataTable.Rows)

foreach (TableCell tc in tr.Cells)

{

switch(tc.GetType().ToString())

{

case "SnowflakeNS.SnowflakeDataCell": ((LiteralControl)(tc.Controls[0])).Text+="*";

break;

case "SnowflakeNS.SnowflakeMemberCell":

tc.ForeColor=Color.Red;

break;

case "SnowflakeNS.SnowflakeAdminCell":

tc.BackColor=Color.Pink;

break;

}

}

}

 

BeforeDrillThrough

BeforeDrillThrough exposes DrillThrough statement and Cancel argument.

Usage example: Next example reads the MDX drillthrough query and cancels the drillthrough action.

private void Snowflake1_BeforeDrillThrough(object sender, SnowflakeNS.Snowflake.BeforeDrillThroughEventArgs e)

{

string myQuery=e.Query;

e.Cancel=true;

}

AddDimNameTranslation

The dimension name translation is not supported in SQL Server Analysis Services. Developer can use following function:

void AddDimNameTranslation

(

string strDimName, string strTranslated

)

to replace a name for the dimension through code.

 

Here is an example that will change the dimension Customers to Test:

SnowflakeNS.Snowflake.AddDimNameTranslation

("[Customers]","[Test]");

 

 

 

 

 

images\imrcleft.gif

Copyright © 2004 Intellimerce Inc. All rights reserved.