WinPivotGrid - it's not just for OLAP anymore... | |
WinPivotGrid is typically associated with OLAP (Online Analytical Processing) data, serving as a front end for MDX and XMLA data sources. It also supports the presentation of non-hierarchical data via the FlatDataSource class. This article discusses the new database adapter classes which were added in the 15.2 release to facilitate the presentation of data obtained from database tables in the WinPivotGrid control. | |
What exactly does 'OLAP' mean anyway?OnLine Analytical Processing. Well, that's what each letter in the acronym stands for, anyway. I'll defer the formal definition to the folks over at OLAP.com, who can presumably explain it better than I: " OLAP is the technology behind many Business Intelligence (BI) applications. OLAP is a powerful technology for data discovery, including capabilities for limitless report viewing, complex analytical calculations, and predictive 'what if' scenario (budget, forecast) planning. " Okay...sounds cool. Data discovery, limitless report viewing, complex calculations, etc. Yes, all these things sound like stuff I'd like to have in my application. How do I get that? | |
OLAP please - and hold the server.So one way to go about incorporating business intelligence into your applications is to familiarize yourself with Microsoft's SQL Server Analysis Services (SSAS) model. You might need to make a few stops along the way for things like server configurations, user permissions, integrating with SQL Server, and then of course on to the actual business of data mining, dimensions, cubes, roles, KPIs...and probably a few acronyms I've neglected to mention. Getting the point? None of this is terribly difficult, but can be time consuming - more so if you don't already have access to these things. Wouldn't it be great if you could bypass all this SSAS business and go straight to the part where your users are slicing and dicing data just like they would on a fancy OLAP server? | |
Introducing the FlatDataSource.Designed specifically so that you can get all that neat multi-dimensional data presentation (and all the slicing, dicing, and filtering that goes along with it), without an OLAP server, the FlatDataSource class was introduced with the 14.2 release. All you need is a standard, garden variety .NET class, and an IEnumerable implementation that contains the instances of this class which comprise your data set. You create a FlatDataSource instance with this IEnumerable implementation, assign it to the WinPivotGrid's DataSource property, and that's really it... What's that? You don't believe me? Alright, let's go through it step-by-step with a quick example.
| |
Adapt and Overcome.In order to address this shortcoming, a new namespace was added in the Infragistics.Olap.DataSource.Flat assembly, Infragistics.Olap.FlatData.Adapters. This namespace contains two new classes, SqlAdapter and OleDbAdapter, each representing a liason between the WinPivotGrid control and a database table or query. These adapters greatly simplify the act of querying a 'standard', i.e., non-OLAP database, and presenting the result in the WinPivotGrid control. In the simplest case, only two properties need to be set - one for the connection string which establishes the connection to the database, and one for the SQL statement that defines the data to be returned. The following code sample gives you an idea of how these adapters work: | |
In closing.Hopefully you'll agree that these data adapters greatly simplify the problem of presenting standard database data in the WinPivotGrid control. If any of the material presented here was unclear, or you have further questions, post in the WinPivotGrid Forum, and we'll be happy to help you out. |
↧
WinPivotGrid - it's not just for OLAP anymore...
↧