in

Prologika Forums

Business Intelligence to the Masses

This Blog

Syndication

News

  • Visit prologika.com for information about Teo's publications, the latest on the Microsoft Business Intelligence initiative, and more...

Prologika (Teo Lachev's Weblog)

Teo Lachev is a consultant, mentor, and author focusing on the design and development of Microsoft .NET business intelligence solutions. Read about Teo's work and life. Registered users can post comments.

How to Get Extended Properties with SSAS OLE DB Provider

Many report developers find the SSAS data provider too restrictive for authoring reports from UDM. Instead, they replace it with the native Microsoft OLE DB Provider for Analysis Services 9.0 which gives them maximum flexibility at the expense of convenience (the query has to be hand-generated, parameters are not supported, extended properties are not available, etc).

By default, the OLE DB provider doesn't return the extended cell properties, such as format and color settings. Thanks to Robert Bruckner from the SSRS team, here is a precious tip to get the extended properties:

  1. Append Extended Properties="ReturnCellProperties=true" to the OLE DB connection string of your data source, e.g.:
    Provider=MSOLAP.3;Data Source=localhost;Initial Catalog="Adventure Works DW";Extended Properties="ReturnCellProperties=true"
  2. Request the cell properties in your MDX query as the SSAS provider does, e.g.:

SELECT NON EMPTY { [Measures].[Internet Sales Amount], … } ON COLUMNS,
NON EMPTY { [Sales Territory].[Sales Territory Group].[Sales Territory Group].ALLMEMBERS , …. }
FROM [Adventure Works]
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

  1. Execute the query. The OLE DB Provider returns the extended properties as fields in the dataset.

You will notice that the OLE DB provider returns the cell colors as numeric values. To convert the SSAS numeric colors to RGB colors for use on your report, you can use this helper function in your report.

int intValue = ConvertToInt32(value, out isValid);

if (isValid) {

return String.Format("#{0:x2}{1:x2}{2:x2}",

(intValue & 0x000000ff),

(intValue >> 8) & 0x000000ff,

(intValue >> 16) & 0x000000ff);

}

Only published comments... Aug 14 2007, 03:01 PM by tlachev

Comments

 

Greg Galloway said:

The point of this post is to discuss how to retrieve cell properties. Specifically, I want to call attention to the ReturnCellProperties setting on an Analysis Services connection and command. I wil ...

August 23, 2007 6:09 PM
Copyright © 2005 Prologika, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems