· New Events – BeforeRender, BeforeDrilThrough
BeforeRender exposes Snowflake DataTable object for read and modification.
BeforeDrillThrough exposes DrillThrough statement and Cancel argument.
o BeforeRender Event
Usage examples: 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;
}
}
}
o BeforeDrilThrough Event
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;
}
· Dimension language setting through API
Added support for dimension language setting through API. 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]");
· Restricted Dimension
Restricted Dimensions are used as means of applying security for dimension members in the Snowflake layer. In many cases the SQL Server Analysis Services security is quite sufficient for implementing the security requirements. However, there are situations where the security information is better left in outside systems and for this particular situation the Snowflake Restricted Dimension support can be used.
Restricted dimension support is implemented through new design/run time property Data->RestrictedDimension (string eg. "Store" or "Store Type" without brackets)
New run-time public methods:
AddRestrictedDimensionTopNode(string UniqueNodeName)
ClearRestrictedDimensionTopNodes()
Example (Foodmart2000, Sales cube, SF id=Snowflake1):
- To set RestrictedDimension at run-time to Store do following in Page_Load:
if (!this.IsPostBack)
{
this.Snowflake1.AddRestrictedDimensionTopNode("[Store].[USA].[OR]");
this.Snowflake1.AddRestrictedDimensionTopNode("[Store].[Mexico]");
}
- Run any MDX without "Store" dimension on axes.
- The user will only be able to see [USA].[OR] and [Store].[Mexico] in the Store dimension.
· Support for Fore_Color and Back_Color in MDX statement
Fore_Color and Back_Color can be used directly in an MDX statement as a way of specifying foreground and background color. For example following MDX statement:
WITH MEMBER MEASURES.DEMO AS 'MEASURES.[UNIT SALES]' , FORE_COLOR='IIF(MEASURES.[UNIT SALES]>10000, RGB(0,255,0), RGB(255,0,0))' SELECT {MEASURES.DEMO} ON ROWS, [Product].[Product Department].MEMBERS ON COLUMNS FROM SALES
specifies different colors depending on the unit sales for the sample Foodmart Sales cube. In Snowflake.net 3.5 these properties are read and the colors will be applied to the data cells to reflect the properties specified in the MDX statement. Note that when the Fore_Color and Back_Color are specified the darkening during the drill-downs does not occur.
Fixes
1. Fixes for situations where there are no rows or columns.
It is possible to create an MDX statement that had no columns or rows. For these situations the Charting subcomponent was not generating any charts. This fix rectifies this situation.
2. Fix for the DRILLTHROUGH case where the cube has a space in the name.
DRILLTHROUGH in situations where the cube had a space in the name would cause creation an invalid MDX statement. This is now fixed.
3. Fix for situations where the "<" and ">" are present in member names.
|
|